Azure CLI Cheat Sheet
Authentication
After creating an Azure AD user in the Azure Portal and creating an access key, configure the Azure CLI interactively using browser-based authentication with:
Show the signed-in user
Alternatively, you can ensure the CLI is configured properly by running the following command to request a new access token for the currently logged in user:
CLI Version Details
Filtering and Querying
Azure Storage
Enumerate Storage
Enumerate all storage accounts in an account:
Enumerate all containers in an Azure storage account:
Enumerate all objects or blobs in a container:
Uploading and Downloading Files from Storage
Uploading
az storage blob upload --account-name <STORAGE_ACCOUNT_NAME> --container-name <CONTAINER_NAME> --name file.txt --file file.txt
Downloading
az storage blob download --account-name <STORAGE_ACCOUNT_NAME> --container-name <CONTAINER_NAME> --name file.txt --file file.txt
Azure Key Vaults
Create a new key vault
Delete a key vault
List Azure Key Vaults for a specific resource group
Show details for a key vault
Resource Groups
Create a resource group
SSH to a Public Cloud VM
ssh ubuntu@$(az vm list-ip-addresses --query "[?virtualMachine.name=='<VM_NAME>'].virtualMachine.network.publicIpAddresses[0].ipAddress" --output tsv)