Describe the bug
Strange behavior with the issue_main.bicep which attempt to create Cognitive Search instances in two different Resource Groups at two different target locations.
Error Reported:
InvalidTemplateDeployment - The template deployment 'aef4bbd2-636a-4a7b-8793-7c376fff78aa' is not valid according to the validation procedure. The tracking id is '8cfce851-0cdd-4c08-bf90-a3b05c541f56'. See inner errors for details.
RegionNotMatched - Location 'West US' is not matched to the locations supported by current RP
RegionNotMatched - Location 'West US 2' is not matched to the locations supported by current RP
Validation pass with the working_main.bicep which attempt to create Cognitive Search instances in two different Resource Group but same target location.
Validation pass with the storage_main.bicep which attempt to create Storage Account instances in two different Resource Group and different target locations (Same as the issue_main.bicep).
Seems something special is happening for Microsoft.Search/searchServices.
Bicep version
Bicep CLI version 0.29.47 (132ade51bc)
Describe the bug Strange behavior with the issue_main.bicep which attempt to create Cognitive Search instances in two different Resource Groups at two different target locations.
Error Reported:
InvalidTemplateDeployment - The template deployment 'aef4bbd2-636a-4a7b-8793-7c376fff78aa' is not valid according to the validation procedure. The tracking id is '8cfce851-0cdd-4c08-bf90-a3b05c541f56'. See inner errors for details. RegionNotMatched - Location 'West US' is not matched to the locations supported by current RP RegionNotMatched - Location 'West US 2' is not matched to the locations supported by current RP
Validation pass with the working_main.bicep which attempt to create Cognitive Search instances in two different Resource Group but same target location.
Validation pass with the storage_main.bicep which attempt to create Storage Account instances in two different Resource Group and different target locations (Same as the issue_main.bicep).
Seems something special is happening for Microsoft.Search/searchServices.
To Reproduce
example.zip
Test-AzDeployment -TemplateFile C:\WORKSPACE\TEMP\Bicep\issue_main.bicep -Location 'West US' Test-AzDeployment -TemplateFile C:\WORKSPACE\TEMP\Bicep\working_main.bicep -Location 'West US' Test-AzDeployment -TemplateFile C:\WORKSPACE\TEMP\Bicep\storage_main.bicep -Location 'West US'
Additional context