Skip to content

fix(azure.ai.agents): skip scale config for vnext hosted agents#7341

Open
spboyer wants to merge 2 commits intomainfrom
fix/remove-vnext-scale
Open

fix(azure.ai.agents): skip scale config for vnext hosted agents#7341
spboyer wants to merge 2 commits intomainfrom
fix/remove-vnext-scale

Conversation

@spboyer
Copy link
Copy Markdown
Member

@spboyer spboyer commented Mar 26, 2026

Summary

Fixes #7267

When enableHostedAgentVNext=true, the platform manages container lifecycle and scaling. The scale block in azure.yaml is unused by the vnext backend and should not be written during agent init.

Changes

  • init.gopopulateContainerSettings() conditionally adds Scale only when vnext is not enabled
  • init_from_code.goaddToProject() conditionally adds Scale the same way
  • listen.go — Preserves existing Scale settings from azure.yaml (no silent data loss), but skips creating new defaults when vnext is enabled

Backward Compatibility

  • Existing azure.yaml files with scale: still work — settings are preserved
  • scale is omitempty in both Go struct and JSON schema — no schema changes needed
  • Deployment code (service_target_agent.go:861) already handles nil Scale gracefully
  • No breaking changes

Testing

cd cli/azd/extensions/azure.ai.agents && go build

When enableHostedAgentVNext=true, the platform manages container
lifecycle and scaling. Don't write the scale block to azure.yaml
during agent init since it's unused by the vnext backend.

Fixes #7267

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

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

Updates the Azure AI Agents extension to avoid writing container.scale defaults into azure.yaml when hosted agent vnext is enabled (enableHostedAgentVNext=true), while still preserving any existing scale settings already present in the project config.

Changes:

  • Conditionally omit creating container.scale defaults during init flows when vnext is enabled.
  • During deploy hooks, preserve an existing container.scale block but avoid generating a new default one for vnext-enabled environments.
  • Guard defaulting logic to handle Scale == nil safely.

Reviewed changes

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

File Description
cli/azd/extensions/azure.ai.agents/internal/cmd/listen.go Preserves existing scale settings but skips creating new defaults for vnext; adds nil-guards around defaulting.
cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_code.go Omits default scale generation during init-from-code when vnext is enabled.
cli/azd/extensions/azure.ai.agents/internal/cmd/init.go Omits default scale generation during interactive init when vnext is enabled.

Accept optional AzdClient parameter in isVNextEnabled to avoid
creating a new gRPC connection on each call. Pass the existing
client from populateContainerSettings (listen.go) and InitAction
(init.go) where one is already available.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Remove scale from config of azure.yaml for hosted agents

2 participants