Skip to content

fix: make Foundry subdomain unique to avoid global CustomDomainInUse#3

Merged
ericchansen merged 1 commit into
mainfrom
fix/unique-foundry-subdomain
May 28, 2026
Merged

fix: make Foundry subdomain unique to avoid global CustomDomainInUse#3
ericchansen merged 1 commit into
mainfrom
fix/unique-foundry-subdomain

Conversation

@ericchansen
Copy link
Copy Markdown
Owner

Problem

CD is failing on main with:

CustomDomainInUse: The subdomain name 'foundry-demo-github-dev' is not available
as it's already used by a resource.

AI Foundry / Cognitive Services account names become the customSubDomainName, which must be globally unique across all of Azure (not just within the subscription). foundry-demo-github-dev is held by some resource not visible from this account — either active in another subscription/tenant, or soft-deleted within the last 48 hours.

Fix

Append a 5-char random suffix to baseName: foundry-demofoundry-demo-qgs3j. The resulting Foundry account name becomes foundry-demo-qgs3j-github-dev, which is unlikely to collide.

Updated:

  • infra/deploy-infra.bicep (default param)
  • infra/environments/{dev,test,prod}.parameters.json

Verification

  • az bicep build infra/deploy-infra.bicep compiles cleanly
  • Key Vault short name still fits the 24-char limit: kv-fd-qgs3j-github-dev = 22 chars
  • Foundry account name well under 64-char limit: foundry-demo-qgs3j-github-dev = 29 chars

Notes

The docs workflow failure on the same commit is a separate, transient GitHub Actions infra glitch (codeload 404 on actions/upload-pages-artifact@v3 after only 1 retry attempt). I re-triggered it; no code fix needed.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Cognitive Services / AI Foundry account names become the customSubDomainName,
which must be globally unique across all of Azure. 'foundry-demo-github-dev'
was already taken (either by an existing or soft-deleted resource in another
subscription/tenant), causing CD to fail with CustomDomainInUse.

Appending a random suffix to baseName ('foundry-demo-qgs3j') makes the resulting
account/subdomain unique per-fork while preserving the naming convention.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 28, 2026 21:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates infrastructure naming defaults to reduce the chance of Azure AI Foundry/Cognitive Services customSubDomainName collisions during deployment.

Changes:

  • Adds a 5-character suffix to the default baseName in the subscription-level Bicep template.
  • Updates dev, test, and prod parameter files to use the suffixed baseName.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
infra/deploy-infra.bicep Updates the default infrastructure base name used when no environment parameter file overrides it.
infra/environments/dev.parameters.json Updates the dev environment base name.
infra/environments/test.parameters.json Updates the test environment base name.
infra/environments/prod.parameters.json Updates the prod environment base name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread infra/deploy-infra.bicep
Comment thread infra/environments/dev.parameters.json
Comment thread infra/environments/test.parameters.json
Comment thread infra/environments/prod.parameters.json
@ericchansen ericchansen merged commit 94b501b into main May 28, 2026
2 checks passed
@ericchansen ericchansen deleted the fix/unique-foundry-subdomain branch May 28, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants