Skip to content

Azure Developer CLI (azd)

Azure Developer CLI manages project environments and provisioning. In APEX, the matching Deploy agent uses the method selected by the approved plan and handoff. azd does not replace the workflow’s policy, preview, or approval gates.

SituationAction
Approved project includes azure.yamlUse its azd path through the matching Deploy agent.
Expected manifest, code, or handoff is missingReturn to CodeGen. Do not generate a generic preparation plan.
Existing project uses standalone Bicep or TerraformFollow its verified handoff and the applicable legacy procedure.
Request is validation-only or preview-onlyReport results and blockers within that scope, then stop.

azd provision manages infrastructure through the configured provider. azd deploy deploys application code for configured services. azd up combines lifecycle work and must not be used as a shortcut for an infrastructure-only authorization.

Legacy deploy.ps1 procedures remain relevant only to existing projects that use them. Do not create a new legacy script to work around a missing manifest. Manifest migration belongs to CodeGen.

Run commands in the relevant generated project directory:

infra/bicep/{project}/
infra/terraform/{project}/

When the project uses azd, azure.yaml and environment state under .azure/ belong there, not at the multi-project repository root. Review environment files before sharing them; they can contain sensitive configuration.

APEX uses the contracts in agent-output/{project}/. It does not require a generic .azure/plan.md. The generic preparation flow in apex-azure-prepare explicitly returns APEX requests to their step owner.

Requirements, Architecture, Governance, and 05-IaC Planner establish the approved inputs. 06b-Bicep CodeGen or 06t-Terraform CodeGen generates the IaC modules, infra/{bicep|terraform}/{project}/azure.yaml, and 05-iac-handoff.json. Never place azure.yaml at the multi-project repository root, and do not ask Deploy to regenerate missing CodeGen artifacts.

Select 07b-Bicep Deploy or 07t-Terraform Deploy and state a validation-only scope:

Validate the APEX project payment-gateway without preview or deployment.
Check the current 05-iac-handoff.json and 04-environment-manifest.json.
Report any missing prerequisites and do not create Azure resources.

Validation reuse requires matching current file hashes, recorded Step 6 phase scope (policy_source current), and tool output.

For an explicitly requested deployment, the deploy agent verifies Step 6 phase scope, runs policy-precheck-subagent and bicep-whatif-subagent or terraform-plan-subagent, presents the previewed changes, and waits for explicit human apply approval:

Prepare to deploy the approved payment-gateway project to its recorded dev target.
Show the current preview and policy precheck results, then wait for my apply approval.

Resource provisioning and application health are verified separately after deployment completes.

Verify the intended subscription, location, environment, resource scope, and authentication before provisioning. Azure CLI and azd have separate authentication contexts.

Terminal window
az account show --output table
az account get-access-token --resource https://management.azure.com/ --output none
azd auth login --check-status

Do not print tokens. Inspect environment values locally, and redact them before including logs in an issue. A missing Terraform backend is a blocker in validation-only or preview-only scope. Bootstrap needs a separate explicit setup/deployment request and authorization.

Use an existing legacy procedure only when the project and its approved deployment method require it. Do not assume generic flags exist in every generated script. Read the script and plan before running it.

The selected agent must preview the same inputs and scope that it will apply. Do not copy an apply command from a historical case study.

Follow the phases in the approved implementation plan. Preview, obtain approval, apply, and verify one phase at a time. A phase name or a previous phase’s success does not authorize the next phase.

Review lifecycle hooks in azure.yaml before running azd. A hook can create resources, modify RBAC, or run schema migrations, so its effects belong inside the approved deployment scope.

Do not append || true to suppress role-assignment or script errors. Inspect the actual exit status, confirm existing idempotent assignments explicitly, and surface unexpected failures.

The manifest declares infra.provider, infra.path, optional services, and lifecycle hooks matching the generated project directory and 05-iac-handoff.json. Consult the official azure.yaml schema reference for syntax details.

FailureNext step
azure.yaml not foundCheck that your working directory is infra/{bicep|terraform}/{project}/, or return to CodeGen if the manifest was omitted.
Missing parameter or environment valueReconcile against 04-environment-manifest.json and recorded owner decisions.
Preview fails despite az loginCheck azd auth login --check-status separately because az and azd maintain distinct token caches.
Terraform backend is missingReport the blocker; never bootstrap remote state during validation-only or preview-only requests.
Policy or preview evidence is staleRe-run policy-precheck-subagent and preview against the current IaC tree before requesting approval.
A lifecycle hook failsPreserve the error output and fix the root cause in the owning step.