azure-search-openai-demo icon indicating copy to clipboard operation
azure-search-openai-demo copied to clipboard

Deploying existing openai account: CustomDomainInUse error

Open mattgotteiner opened this issue 1 year ago • 1 comments

Please provide us with the following information:

This issue is for a: (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

If I deploy an already existing openai cognitive services account, I see an error similar to the following:

InvalidTemplateDeployment: The template deployment 'openai' is not valid according to the validation procedure. The tracking id is '857a0cad-802d-440b-bea7-87155ea1992b'. See inner errors for details.
CustomDomainInUse: Please pick a different name. The subdomain name 'cog-xxx' is not available as it's already used by a resource. If the resource using the name was deleted in the last 48 hours, you may need to purge the deleted resource. Learn more at "https://go.microsoft.com/fwlink/?linkid=2215493"

Expected/desired behavior

I don't see this error. If I add the following parameter to the openai module the issue goes away

module openAi 'core/ai/cognitiveservices.bicep' = {
  name: 'openai'
  scope: openAiResourceGroup
  params: {
    name: !empty(openAiServiceName) ? openAiServiceName : '${abbrs.cognitiveServicesAccounts}${resourceToken}'
    location: openAiResourceGroupLocation
    tags: tags
    sku: {
      name: openAiSkuName
    }
    deployments: openAiDeployments
    customSubDomainName: ''
  }
}

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?) Windows

azd version?

run azd version and copy paste here. 1.5.1


Thanks! We'll be in touch soon.

mattgotteiner avatar Dec 27 '23 18:12 mattgotteiner

Were you able to solve it? I have the same problem and I can't use an existing resource.

druidajes avatar May 13 '24 10:05 druidajes