Skip to main content

Azure CLI

docs

Installation

You can Install the Azure CLI on any platform, Windows or Linux (including Windows Subsystem for Linux)

Basic commands

CommandAction
az --versionCheck the CLI version
az --helpDisplay help information
az loginLogin to a specific Azure user account (will open a web page in a browser)
az account listList all subscriptions you have access
az account set --subscription "xxxxx-xxxx-xxxx-xxxx-xxxxxx"Set the current context to a specific subscription
az account showDisplay the current context

AKS commands

CommandAction
az aks get-credentials --resource-group rg-xxx --name aks-xxx [--admin]Get Kubernetes credentials for a specific cluster
az aks browse --resource-group rg-xxx --name aks-xxxOpen Kubernetes dashboard (will open a browser)

Recipes

az webapp config container set --name mywebappresourcename --resource-group myresourcegroup --docker-custom-image-name mycontainerregistry.azurecr.io/repositorytname:imagetag --docker-registry-server-url https://mycontainerregistry.azurecr.io --docker-registry-server-user myacruser --docker-registry-server-password myacrpassword