Skip to content

2.2 - Installation & Commands

Today we cover installing AZD on different platforms and explore the complete command reference to become AZD power users.

  • How to install AZD on Windows, macOS, and Linux
  • Complete AZD command reference
  • Configuration and customization options
  • Tips and tricks for efficient AZD usage

Before diving in, review these resources:

  1. 📘 Install Azure Developer CLI - Official installation guide
  2. 📘 AZD Command Reference - Complete command documentation
  3. 📘 AZD Configuration - Customization options

Option 1: Windows Package Manager (winget)

Terminal window
winget install microsoft.azd

Option 2: PowerShell Script

Terminal window
powershell -ex AllSigned -c "Invoke-RestMethod 'https://aka.ms/install-azd.ps1' | Invoke-Expression"

Option 3: MSI Installer Download from aka.ms/azd-windows

Verify Installation:

Terminal window
azd version

Option 1: Homebrew

Terminal window
brew tap azure/azd
brew install azd

Option 2: Install Script

Terminal window
curl -fsSL https://aka.ms/install-azd.sh | bash

Verify Installation:

Terminal window
azd version

Option 1: Install Script

Terminal window
curl -fsSL https://aka.ms/install-azd.sh | bash

Option 2: Package Managers

Ubuntu/Debian:

Terminal window
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

RHEL/CentOS:

Terminal window
curl -sL https://aka.ms/InstallAzureCLIRPM | sudo bash

Add to devcontainer.json:

{
"features": {
"ghcr.io/azure/azure-dev/azd:latest": {}
}
}

Pre-installed in many Azure templates. If not, use install script.

GitHub Actions:

- name: Install azd
uses: Azure/setup-azd@v0.1.0

Azure Pipelines:

- task: Bash@3
displayName: Install azd
inputs:
targetType: inline
script: |
curl -fsSL https://aka.ms/install-azd.sh | bash
CommandPurposeExample
azd initInitialize projectazd init --template <template>
azd upProvision + Deployazd up
azd provisionCreate infrastructureazd provision
azd deployDeploy applicationazd deploy api
azd downDelete resourcesazd down --force
CommandPurposeExample
azd auth loginSign in to Azureazd auth login --use-device-code
azd auth logoutSign outazd auth logout
azd auth tokenGet access tokenazd auth token --output json
CommandPurposeExample
azd env newCreate environmentazd env new prod
azd env listList environmentsazd env list
azd env selectSet active environmentazd env select dev
azd env setSet variableazd env set API_KEY "value"
azd env get-valuesShow all variablesazd env get-values
azd env refreshSync environmentazd env refresh
CommandPurposeExample
azd monitorView telemetryazd monitor --overview
azd showShow app infoazd show
azd versionShow versionazd version
azd configManage configazd config list
CommandPurposeExample
azd template listBrowse templatesazd template list
azd template showShow template detailsazd template show <template>
azd template source addAdd template sourceazd template source add <name> <url>
CommandPurposeExample
azd infra createCreate infra fileazd infra create
azd infra synthGenerate ARM from Bicepazd infra synth
azd infra deleteDelete infrastructureazd infra delete
CommandPurposeExample
azd pipeline configConfigure CI/CDazd pipeline config

Available on all commands:

Terminal window
--cwd <path> # Change working directory
--debug # Enable debug logging
--no-prompt # Disable interactive prompts
--output <format> # Output format: json, table, none
--verbose # Verbose logging

Example:

Terminal window
azd provision --debug --output json --no-prompt

azd init

Terminal window
--template <name> # Template to use
--location <region> # Azure region
--subscription <id> # Azure subscription

azd provision

Terminal window
--preview # Show changes without deploying
--no-state # Don't save state
--no-progress # Disable progress indicator

azd deploy

Terminal window
--service <name> # Deploy specific service
--from-package <path> # Deploy from package
--all # Deploy all services

azd down

Terminal window
--force # Skip confirmation
--purge # Remove soft-deleted resources
--no-wait # Don't wait for completion

View Configuration:

Terminal window
azd config list

Set Values:

Terminal window
azd config set defaults.location eastus
azd config set defaults.subscription <subscription-id>
azd config set telemetry.enabled true
azd config set output.format json

Configuration File: ~/.azd/config.json

name: my-app
metadata:
template: my-app@1.0.0
services:
api:
project: ./src/api
language: python
host: containerapp
hooks:
postprovision:
- echo "Custom hook"
pipeline:
provider: github

Create shell aliases for frequently used commands:

Bash/Zsh (~/.bashrc or ~/.zshrc):

Terminal window
alias azdup='azd up'
alias azdp='azd provision'
alias azdd='azd deploy'
alias azdm='azd monitor --overview'
alias azdown='azd down'

PowerShell (Profile):

Terminal window
function azdup { azd up }
function azdp { azd provision }
function azdd { azd deploy }
function azdm { azd monitor --overview }
function azdown { azd down }
Terminal window
azde() {
azd env select $1
azd env get-values
}
azde dev
azde prod

Always preview infrastructure changes:

Terminal window
azd provision --preview
azd provision

When iterating on code:

Terminal window
azd deploy api # Only deploy API
azd deploy web # Only deploy web
Terminal window
azd show
azd show --open-portal
Terminal window
azd deploy --debug
azd monitor --logs
#!/bin/bash
for env in dev test prod; do
azd env select $env
azd provision
azd deploy
done
Terminal window
azd env set AZURE_LOCATION eastus \
API_PORT 8000 \
LOG_LEVEL DEBUG
Terminal window
azd env get-values > config.txt

Enable tab completion for faster typing:

Bash:

Terminal window
echo 'source <(azd completion bash)' >> ~/.bashrc

Zsh:

Terminal window
echo 'source <(azd completion zsh)' >> ~/.zshrc

PowerShell:

Terminal window
azd completion powershell | Out-String | Invoke-Expression

Check Current Version:

Terminal window
azd version

Update to Latest:

Terminal window
azd upgrade

Install Specific Version:

Terminal window
winget install microsoft.azd --version 1.5.0
curl -fsSL https://aka.ms/install-azd.sh | bash -s -- --version 1.5.0

Windows:

Terminal window
winget uninstall microsoft.azd

macOS:

Terminal window
brew uninstall azd

Linux:

Terminal window
sudo rm $(which azd)

Explore AZD commands:

  1. “What are the performance implications of using ‘—debug’ flag in production deployments?”
  2. “How do you configure azd to work behind a corporate proxy?”
  3. “What’s the best practice for managing azd configuration across a team of developers?”

Next: Day 10 - Finding Templates

Tomorrow we’ll explore the AZD template gallery and learn how to find the perfect template for your project.