Skip to content

Azure CLI

Installation

brew install azure-cli
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
# winget
winget install Microsoft.AzureCLI

# scoop
scoop install azure-cli

Login

az login
az login --use-device-code    # for remote sessions

Subscription

az account list -o table
az account set -s "<name-or-id>"

Resource Group

az group list -o table
az resource list -g <rg> -o table

Container Registry (ACR)

az acr list -o table
az acr login -n <acr-name>

Key Vault

az keyvault list -o table
az keyvault secret list --vault-name <kv-name> -o table
az keyvault secret show --vault-name <kv-name> -n <secret-name> --query value -o tsv

AKS

az aks list -o table
az aks get-credentials -g <rg> -n <cluster>