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
- Have a unified Foundry
azure.yaml whose agent service is container-style.
- 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
Summary
When adopting a unified Foundry
azure.yamlviaazd ai agent init -m <azure.yaml>, the--deploy-mode codeflag (and the related--runtime/--entry-pointflags) is ignored. The adoptedazure.yamlis written to the project root unchanged, so the agent service is never updated with acode_configuration. When-mpoints at an agent manifest instead,--deploy-mode codecorrectly writes the code configuration intoazure.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.yamlwith-mneeds to also handle these flags and update theazure.yamlaccordingly.Repro
azure.yamlwhose agent service is container-style.azd ai agent init -m <azure.yaml> --deploy-mode code(optionally with--runtime/--entry-point).Expected: the adopted
azure.yamlagent service is updated with acode_configuration(runtime, entry point, etc.), the same way the agent-manifest path does.Actual: the
azure.yamlis adopted as-is.--deploy-mode codehas no effect; nocode_configurationis written and the flags are silently ignored.Root cause
The adoption path
runInitFromAzureYaml(added in PR #8885) receives*initFlagsbut only readsflags.src,flags.manifestPointer, andflags.env. It never readsflags.deployMode,flags.runtime, orflags.entryPoint, andinit_adopt.gocontains 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 acode_configurationviapromptCodeConfig, sets it on the agent template, and persists it intoazure.yamlviaaddToProject:cli/azd/extensions/azure.ai.agents/internal/cmd/init.go(deploy-mode / code-config handling around lines 1604-1643;addToProjectat ~1709)Since the adoption path short-circuits before any of that runs, the deploy-mode flags are dropped and the adopted
azure.yamlis never rewritten.Suggested fix
The unified-
azure.yamladoption path needs to honor the init flags -- at minimum--deploy-mode(code/container), and for code deploy--runtime/--entry-point-- and update the adoptedazure.yamlagent service'scode_configurationaccordingly (prompting interactively when the flags are omitted, matching the agent-manifest flow). This is a missing feature of theazure.yaml-msupport.Environment