Describe the bug
When deploying the solution, the deployment consistently fails during Azure Cognitive Search provisioning with the error:
InvalidResourceLocation
The resource 'search-name' already exists in location 'region-A'.
A resource with the same name cannot be created in location 'region-B'.
This error occurs even when the resource does not exist prior to deployment.
I believe the root cause is that the Azure Cognitive Search service is declared twice in the same deployment:
- Once as a native ARM resource:
resource searchService 'Microsoft.Search/searchServices@2024-06-01-preview'
- A second time via the AVM module:
module searchServiceUpdate 'br/public:avm/res/search/search-service:0.11.1'
Debugging information
Steps to reproduce
Steps to reproduce the behavior:
- Run deployment using Azure Developer CLI:
azd up
- Provide any valid supported values
- Deployment fails with:
InvalidResourceLocation
The resource '' already exists in location ''
- See error## Screenshots

Describe the bug
When deploying the solution, the deployment consistently fails during Azure Cognitive Search provisioning with the error:
InvalidResourceLocation
The resource 'search-name' already exists in location 'region-A'.
A resource with the same name cannot be created in location 'region-B'.
This error occurs even when the resource does not exist prior to deployment.
I believe the root cause is that the Azure Cognitive Search service is declared twice in the same deployment:
resource searchService 'Microsoft.Search/searchServices@2024-06-01-preview'
module searchServiceUpdate 'br/public:avm/res/search/search-service:0.11.1'
Debugging information
Steps to reproduce
Steps to reproduce the behavior:
azd up
InvalidResourceLocation
The resource '' already exists in location ''