Skip to content

azd ai agent init -m <azure.yaml> ignores --deploy-mode code and does not update the adopted azure.yaml #8923

Description

@therealjohn

Summary

When adopting a unified Foundry azure.yaml via azd ai agent init -m <azure.yaml>, the --deploy-mode code flag (and the related --runtime / --entry-point flags) is ignored. The adopted azure.yaml is written to the project root unchanged, so the agent service is never updated with a code_configuration. When -m points at an agent manifest instead, --deploy-mode code correctly writes the code configuration into azure.yaml.

This shares the same root cause as #8922: the new adoption path added in PR #8885 does not process any of the init flags. Supporting azure.yaml with -m needs to also handle these flags and update the azure.yaml accordingly.

Repro

  1. Have a unified Foundry azure.yaml whose agent service is container-style.
  2. Run azd ai agent init -m <azure.yaml> --deploy-mode code (optionally with --runtime / --entry-point).

Expected: the adopted azure.yaml agent service is updated with a code_configuration (runtime, entry point, etc.), the same way the agent-manifest path does.

Actual: the azure.yaml is adopted as-is. --deploy-mode code has no effect; no code_configuration is written and the flags are silently ignored.

Root cause

The adoption path runInitFromAzureYaml (added in PR #8885) receives *initFlags but only reads flags.src, flags.manifestPointer, and flags.env. It never reads flags.deployMode, flags.runtime, or flags.entryPoint, and init_adopt.go contains no code-configuration handling at all:

  • cli/azd/extensions/azure.ai.agents/internal/cmd/init_adopt.go (runInitFromAzureYaml, lines 163-216)

By contrast, the agent-manifest path resolves deploy mode with promptDeployMode, and when code deploy is selected builds a code_configuration via promptCodeConfig, sets it on the agent template, and persists it into azure.yaml via addToProject:

  • cli/azd/extensions/azure.ai.agents/internal/cmd/init.go (deploy-mode / code-config handling around lines 1604-1643; addToProject at ~1709)

Since the adoption path short-circuits before any of that runs, the deploy-mode flags are dropped and the adopted azure.yaml is never rewritten.

Suggested fix

The unified-azure.yaml adoption path needs to honor the init flags -- at minimum --deploy-mode (code/container), and for code deploy --runtime / --entry-point -- and update the adopted azure.yaml agent service's code_configuration accordingly (prompting interactively when the flags are omitted, matching the agent-manifest flow). This is a missing feature of the azure.yaml -m support.

Environment

Metadata

Metadata

Assignees

Labels

area/projectProject config, project_manager, service_managerarea/schemaazure.yaml JSON schemasbugSomething isn't workingext-agentsazure.ai.agents extension

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions