The Azure Developer CLI (azd) is a high-level tool designed to accelerate the process of building, deploying, and monitoring applications on Azure. Unlike the standard Azure CLI (az), which is granular and resource-focused, azd is workflow-focused.

🚀 The Core Workflow

The most common “Golden Path” for getting an app into the cloud.

Command Description
azd init Initializes a new project from a template. You can choose from the “Awesome ADZ” gallery or use a local repository.
azd up The “Magic” Command. Runs package, provision, and deploy in a single step. Use this for the first deployment or major updates.
azd down Removes all Azure resources associated with the current environment to save costs.

🏗️ Infrastructure & Deployment

Use these for more granular control over your development cycle.

  • azd provision: Creates or updates the Azure infrastructure (Bicep or Terraform) without deploying code.
  • azd package: Bundles your application code into a deployable artifact (like a zip file or Docker image).
  • azd deploy: Pushes your packaged code to the provisioned Azure resources. Use this for quick code updates that don’t change infrastructure.
  • azd auth login: Log in to your Azure account. (Newer version of the deprecated azd login).
  • azd auth status: Check which account and tenant are currently active.

🌿 Environment Management

azd allows you to maintain separate settings for dev, test, and prod within the same codebase.

  • azd env list: Shows all environments created for this project.
  • azd env new <name>: Creates a new environment (e.g., azd env new staging).
  • azd env select <name>: Switches your active context to a different environment.
  • azd env get-value <KEY>: Retrieves a specific value from your .env file (like a database endpoint).
  • azd env refresh: Syncs your local .env file with the actual values currently in Azure.

📊 Monitoring & Insights

Once the app is live, use these to check its health without opening the Azure Portal.

Flag Command
azd monitor --overview Opens the Application Insights dashboard in your browser.
azd monitor --live Streams live metrics (requests, CPU, memory) to your terminal.
azd monitor --logs Opens the Log Analytics dashboard for deep debugging.

🛠️ Inspection & Configuration

  • azd show: Displays a summary of your project, including the URL of the deployed app and its resource group.
  • azd config set <key> <value>: Configure global settings (e.g., setting the default Azure location).
  • azd template list: Browses available starter templates (e.g., React + Node.js + CosmosDB).
  • azd pipeline config: Automatically generates a GitHub Actions or Azure DevOps pipeline to automate your deployments.

Why use azd instead of az?

Use az when you need to manage a specific storage account or set a specific firewall rule. Use azd when you want to manage the entire lifecycle of an application (Code + Infra + CI/CD) as a single unit.