Skip to content

fix(ai-projects): cap Foundry ARM deployment names - #9292

Merged
hund030 merged 1 commit into
Azure:mainfrom
hund030:fix/foundry-deployment-name-length
Jul 27, 2026
Merged

fix(ai-projects): cap Foundry ARM deployment names#9292
hund030 merged 1 commit into
Azure:mainfrom
hund030:fix/foundry-deployment-name-length

Conversation

@hund030

@hund030 hund030 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the deployment-name length failure reported in #9210. Long azd environment names currently produce Foundry ARM deployment names beyond ARM's 64-character limit, blocking both provision and preview.

Changes

  • Foundry provisioning: truncate only long environment-name segments and retain deterministic environment and project-path hashes for uniqueness.
  • Deployment-name tests: cover the reported Windows project path, collision resistance after truncation, and unchanged names that already fit.

Changing an existing environment's Azure location remains subject to ARM's deployment-location rules; users should create a new azd environment or run azd down before reprovisioning in another region.

Copilot AI review requested due to automatic review settings July 24, 2026 10:47
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
21 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Caps Foundry ARM deployment names at 64 characters while preserving stable hashes and backward-compatible short names.

Changes:

  • Truncates long environment-name segments and appends environment/project hashes.
  • Adds coverage for length limits, stability, and collision resistance.

Reviewed changes

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

File Description
foundry_provisioning_provider.go Implements capped deployment names.
foundry_provisioning_provider_test.go Tests short and long naming behavior.

@github-actions github-actions Bot added the ext-projects azure.ai.projects extension label Jul 24, 2026

@jongio jongio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One inline question on the brownfield deployment-name path. Non-blocking: the 64-char cap and the greenfield env-name-hash disambiguation are correct as written.

@jongio jongio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Greenfield 64-char cap and the env-name-hash disambiguation for truncated names are correct, and the added tests cover the length limit and the same-prefix collision case. My earlier note on the brownfield path dropping the env-name hash is a pre-existing edge case, not introduced here, so it's non-blocking.

@jongio jongio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The fix caps ARM deployment names at 64 chars and adds an env-name hash so long env names that truncate to the same readable prefix stay distinct. Slice bounds are safe in both paths since truncation only runs once the name already exceeds 64 chars, and the new tests cover the long-env-name case. The brownfield edge case I flagged inline is pre-existing and fine to defer.

@jongio jongio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The fix keeps names that already fit unchanged, so existing environments still update the same deployment record on re-runs. Long env names now truncate to a deterministic 64-char name, and the env-name hash keeps two long names in the same project distinct. Tests cover the reported Windows project path and collision resistance.

@jongio jongio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Re-reviewed the deployment-name truncation. Both the greenfield and brownfield paths cap at ARM's 64-character limit, and the env-name hash keeps long names distinct after the readable segment is truncated. Tests cover the reported Windows project path, collision resistance after truncation, and names that already fit. The brownfield truncated form still folds away the env-name hash, but that is pre-existing and non-blocking.

@hund030
hund030 merged commit 976357a into Azure:main Jul 27, 2026
29 of 30 checks passed
@hund030
hund030 deleted the fix/foundry-deployment-name-length branch July 27, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-projects azure.ai.projects extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue] Deployment name is constant around all the provisions of an agent.

5 participants