Javad Zahrabi

Azure CLI

Microsoft Azure command-line client (az ...) — login, subscriptions, AKS basics.

Official docs

Login & subscriptions

  • az login

    Browser-based interactive login.

  • az login --tenant <tenant-id>

    Pin the login to a specific tenant (multi-tenant accounts).

  • az login --service-principal -u <appId> -p <secret> --tenant <tenant>

    Non-interactive SP login. Used in CI.

  • az account list -o table

    All subscriptions you can see + which is default.

  • az account set --subscription <id-or-name>

    Switch the active subscription.

  • az account show

    Currently active subscription + tenant.

Resource groups & generic queries

  • az group list -o table

    All resource groups in the active subscription.

  • az group create -n my-rg -l westeurope

    Create a resource group in a region.

  • az group delete -n my-rg --yes --no-wait

    Tear down a resource group asynchronously. Drops everything inside.

  • az resource list -g my-rg -o table

    Every resource inside a group.

  • az resource list --query "[?type=='Microsoft.Storage/storageAccounts'].name"

    JMESPath query — filter resources to just the names of storage accounts.

AKS

  • az aks list -o table

    All AKS clusters in the active subscription.

  • az aks get-credentials -g my-rg -n my-cluster

    Merge the cluster's kubeconfig into ~/.kube/config.

  • az aks get-credentials -g my-rg -n my-cluster --admin

    Get the cluster-admin context (bypasses Azure AD).

  • az aks browse -g my-rg -n my-cluster

    Open the k8s dashboard via a local proxy.

  • az aks upgrade -g my-rg -n my-cluster --kubernetes-version 1.30.0

    Upgrade the control plane + node pools.

Storage & container registry

  • az storage account list -o table

    Storage accounts in the active subscription.

  • az storage blob list --account-name <acct> -c <container> -o table

    List blobs in a container.

  • az acr login -n <registry>

    Authenticate Docker against an Azure Container Registry.

  • az acr repository list -n <registry> -o table

    List repos in an ACR.