Microsoft Docs

Azure Command-Line Interface (CLI) Reference

This section provides a comprehensive reference for the Azure CLI commands. Explore common commands, their arguments, and examples to manage your Azure resources efficiently.

az account

Manage Azure subscriptions and user accounts.

Syntax

az account [command] --query <json_query> --output <output_format>

Arguments

Argument Description
--query JMESPath query string. See examples.
--output, -o Output format. Options: json, jsonc, table, tsv, yaml, none.
--verbose, -v Increase logging verbosity.
--debug Show debug logs.

Subcommands

  • az account get-access-token: Get an access token for authenticating with Azure Resource Manager.
  • az account list: List subscriptions.
  • az account set: Set a subscription as the current active subscription.
  • az account show: Show details of the current active subscription.

Example

az account list --output table

az vm

Manage virtual machines.

Syntax

az vm [command] [options]

Subcommands

  • az vm create: Create a virtual machine.
  • az vm list: List virtual machines.
  • az vm show: Get the details of a virtual machine.
  • az vm delete: Delete a virtual machine.
  • az vm start: Start a virtual machine.
  • az vm stop: Stop a virtual machine.

Example

az vm create --resource-group MyResourceGroup --name MyVM --image UbuntuLTS --admin-username azureuser --generate-ssh-keys

az storage

Manage Azure Storage resources.

Syntax

az storage [container] [command] [options]

Subcommands

  • az storage blob: Manage blob storage.
  • az storage container: Manage storage containers.
  • az storage file: Manage file shares.
  • az storage queue: Manage storage queues.
  • az storage table: Manage storage tables.

Example

az storage blob list --account-name mystorageaccount --container-name mycontainer

az webapp

Manage Azure App Service web apps.

Syntax

az webapp [command] [options]

Subcommands

  • az webapp create: Create a web app.
  • az webapp list: List web apps.
  • az webapp deploy: Deploy code to a web app.
  • az webapp delete: Delete a web app.

Example

az webapp create --resource-group MyResourceGroup --name MyUniqueWebAppName --plan MySkuPlan --runtime "NODE:16-lts"

az aks

Manage Azure Kubernetes Service (AKS) clusters.

Syntax

az aks [command] [options]

Subcommands

  • az aks create: Create an AKS cluster.
  • az aks get-credentials: Get cluster credentials for kubectl.
  • az aks list: List AKS clusters.
  • az aks delete: Delete an AKS cluster.

Example

az aks create --resource-group MyResourceGroup --name MyAKSCluster --node-count 1 --enable-addons monitoring

az cosmosdb

Manage Azure Cosmos DB accounts.

Syntax

az cosmosdb [command] [options]

Subcommands

  • az cosmosdb create: Create an Azure Cosmos DB account.
  • az cosmosdb list: List Azure Cosmos DB accounts.
  • az cosmosdb show: Show the details of an Azure Cosmos DB account.
  • az cosmosdb delete: Delete an Azure Cosmos DB account.

Example

az cosmosdb create --name MyCosmosDbAccount --resource-group MyResourceGroup --kind GlobalDocumentDB

az keyvault

Manage Azure Key Vault secrets, keys, and certificates.

Syntax

az keyvault [command] [options]

Subcommands

  • az keyvault create: Create a Key Vault.
  • az keyvault secret set: Set a secret in a Key Vault.
  • az keyvault secret list: List secrets in a Key Vault.
  • az keyvault delete: Delete a Key Vault.

Example

az keyvault create --name MyKeyVaultName --resource-group MyResourceGroup --location westus