Skip to content

Azure Cognitive Search deployment fails #902

@sudino

Description

@sudino

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:

  1. Once as a native ARM resource:
    resource searchService 'Microsoft.Search/searchServices@2024-06-01-preview'
  2. 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:

  1. Run deployment using Azure Developer CLI:
    azd up
  2. Provide any valid supported values
  3. Deployment fails with:
    InvalidResourceLocation
    The resource '' already exists in location ''
  4. See error## Screenshots
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions