Summary
Since PR #8885 (feat: adopt unified azure.yaml in azd ai agent init -m), running azd ai agent init -m <azure.yaml> (pointing -m at a unified Foundry azure.yaml) no longer runs the interactive environment setup steps -- selecting a subscription, selecting/creating a Foundry project, model configuration, and deploy-mode selection. The command stages/adopts the sample's azure.yaml, scaffolds the project, prints next steps, and returns without any Azure context prompting.
Pointing -m at an agent manifest (top-level template:) still runs the full interactive flow. Only the new unified azure.yaml adoption path is affected.
Repro
- Have a unified Foundry
azure.yaml (a manifest whose services: declare a Foundry host such as azure.ai.agent / azure.ai.project).
- Run
azd ai agent init -m <path-or-url-to-azure.yaml> in an interactive terminal.
Expected: after adopting the manifest, azd prompts for subscription, Foundry project (existing vs new), model configuration, etc., the same way it does when -m points at an agent manifest.
Actual: azd adopts the azure.yaml, prints next steps, and exits. No subscription / Foundry project / model prompts appear.
Root cause
PR #8885 added an early-return branch to the init command's RunE. When the -m pointer is detected as a unified Foundry azure.yaml (via looksLikeFoundryAzureYaml), it calls runInitFromAzureYaml and returns immediately:
cli/azd/extensions/azure.ai.agents/internal/cmd/init.go (routing/early return, around lines 1212-1222)
runInitFromAzureYaml only stages the template, scaffolds the project (scaffoldProject -> azd init -t), stamps infra.provider: microsoft.foundry, and prints next steps:
cli/azd/extensions/azure.ai.agents/internal/cmd/init_adopt.go (runInitFromAzureYaml, lines 163-216)
It never invokes InitAction.Run / runInitFromManifest, which is where the interactive Azure setup lives for the agent-manifest path:
- subscription selection via
ensureSubscription
- Foundry project selection via
selectFoundryProject
- model configuration via
configureModelChoice
- deploy-mode selection via
promptDeployMode
(see InitAction.Run around lines 1550-1719 and configureModelChoice at 1973+ in cli/azd/extensions/azure.ai.agents/internal/cmd/init.go)
Because the adoption path short-circuits before any of that runs, none of the environment setup prompts happen.
Suggested fix
After adopting the unified azure.yaml, the adoption path should still run the interactive environment setup (subscription, Foundry project selection/creation, model configuration) so the user ends up with a provision-ready environment, matching the agent-manifest flow. This likely means invoking the shared Azure-context / InitAction setup after scaffoldProject instead of returning early.
Environment
Summary
Since PR #8885 (feat: adopt unified azure.yaml in azd ai agent init -m), running
azd ai agent init -m <azure.yaml>(pointing-mat a unified Foundryazure.yaml) no longer runs the interactive environment setup steps -- selecting a subscription, selecting/creating a Foundry project, model configuration, and deploy-mode selection. The command stages/adopts the sample'sazure.yaml, scaffolds the project, prints next steps, and returns without any Azure context prompting.Pointing
-mat an agent manifest (top-leveltemplate:) still runs the full interactive flow. Only the new unifiedazure.yamladoption path is affected.Repro
azure.yaml(a manifest whoseservices:declare a Foundry host such asazure.ai.agent/azure.ai.project).azd ai agent init -m <path-or-url-to-azure.yaml>in an interactive terminal.Expected: after adopting the manifest, azd prompts for subscription, Foundry project (existing vs new), model configuration, etc., the same way it does when
-mpoints at an agent manifest.Actual: azd adopts the
azure.yaml, prints next steps, and exits. No subscription / Foundry project / model prompts appear.Root cause
PR #8885 added an early-return branch to the init command's
RunE. When the-mpointer is detected as a unified Foundryazure.yaml(vialooksLikeFoundryAzureYaml), it callsrunInitFromAzureYamland returns immediately:cli/azd/extensions/azure.ai.agents/internal/cmd/init.go(routing/early return, around lines 1212-1222)runInitFromAzureYamlonly stages the template, scaffolds the project (scaffoldProject->azd init -t), stampsinfra.provider: microsoft.foundry, and prints next steps:cli/azd/extensions/azure.ai.agents/internal/cmd/init_adopt.go(runInitFromAzureYaml, lines 163-216)It never invokes
InitAction.Run/runInitFromManifest, which is where the interactive Azure setup lives for the agent-manifest path:ensureSubscriptionselectFoundryProjectconfigureModelChoicepromptDeployMode(see
InitAction.Runaround lines 1550-1719 andconfigureModelChoiceat 1973+ incli/azd/extensions/azure.ai.agents/internal/cmd/init.go)Because the adoption path short-circuits before any of that runs, none of the environment setup prompts happen.
Suggested fix
After adopting the unified
azure.yaml, the adoption path should still run the interactive environment setup (subscription, Foundry project selection/creation, model configuration) so the user ends up with a provision-ready environment, matching the agent-manifest flow. This likely means invoking the shared Azure-context /InitActionsetup afterscaffoldProjectinstead of returning early.Environment