Skip to content

Persist first deployment name in AZURE_AI_MODEL_DEPLOYMENT_NAME#7633

Merged
rajeshkamal5050 merged 2 commits into
Azure:mainfrom
therealjohn:fix-7632
Apr 10, 2026
Merged

Persist first deployment name in AZURE_AI_MODEL_DEPLOYMENT_NAME#7633
rajeshkamal5050 merged 2 commits into
Azure:mainfrom
therealjohn:fix-7632

Conversation

@therealjohn

Copy link
Copy Markdown
Contributor

Fixes #7632.

The env var was only set in the from-code path). The from-manifest path (ProcessModels) collected deployment details but never persisted the env var. This affected users who init via --manifest, templates, or --model/--model-deployment flags on those paths.

Fix: Added a setEnvValue call in ProcessModels() after deployment details are collected, using the first deployment's name. This covers all manifest/template init paths since they all flow through ProcessModel

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

This PR fixes a gap in the azure.ai.agents extension init flow where AZURE_AI_MODEL_DEPLOYMENT_NAME was only persisted for the “from-code” path, ensuring it is also set when initializing from a manifest/template flow (ProcessModels).

Changes:

  • Persist AZURE_AI_MODEL_DEPLOYMENT_NAME during ProcessModels() using the first resolved deployment’s name.
  • Fail initialization if persisting the env var fails (consistent with existing from-code behavior).

Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init_models.go Outdated

@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.

Clean fix. Mirrors the existing setEnvValue pattern from init_from_code.go, proper guard check on empty deploymentDetails, and correct error wrapping. Nothing to flag.

@rajeshkamal5050 rajeshkamal5050 merged commit e686dba into Azure:main Apr 10, 2026
19 checks passed
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.

AZURE_AI_MODEL_DEPLOYMENT_NAME is only set when using existing code

5 participants