Skip to content

azd ai agent init: Add --model-deployment flag for non-interactive usage #6816

Description

@spboyer

Problem

\�zd ai agent init\ is unusable in non-interactive (non-TTY) environments because the model deployment selection step has no CLI flag to bypass the interactive prompt. This blocks CI/CD pipelines, IDE-integrated terminals, AI coding assistants, and any scripted automation.

Current Behavior

When running in non-TTY mode, --no-prompt\ is silently activated. The command successfully downloads the manifest, validates the YAML, and loads the model catalog, then fails with:

\
failed to prompt for model deployment: rpc error: code = FailedPrecondition
desc = cannot prompt for deployment configuration in non-interactive mode
\\


esolveModelDeploymentNoPrompt()\ in \init_models.go\ exists and attempts auto-selection based on SKU priority and capacity, but when it cannot find a candidate, there is no way to provide the value via CLI flag.

Proposed Solution

Add flags to allow explicit model deployment specification:

  • --model-deployment \ - Select an existing deployment by name
  • Optionally: --model-name \ and --model-version \ for more granular control

When provided, these flags should skip both the interactive prompt and the auto-resolution logic, directly using the specified deployment.

Impact

P1 blocker for non-interactive adoption. Any non-TTY environment cannot complete \�zd ai agent init\ for manifests requiring model deployment configuration.

Files

  • \cli/azd/extensions/azure.ai.agents/internal/cmd/init_models.go\ - Model deployment selection logic
  • \cli/azd/extensions/azure.ai.agents/internal/cmd/init.go\ - Flag registration

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions