$linuxjunkies
>

az(1)

The Azure CLI command-line interface for managing Azure cloud resources and services.

UbuntuDebianFedoraArch

Synopsis

az [OPTIONS] COMMAND [ARGS]...

Description

The Azure CLI (az) is a cross-platform command-line tool for managing Azure resources. It provides a consistent interface for provisioning, configuring, and managing cloud infrastructure on Microsoft Azure.

Commands are organized hierarchically by service (e.g., az vm, az storage, az webapp). Each command accepts options and arguments specific to its function, and most operations support output formatting in JSON, table, or TSV formats.

Common options

FlagWhat it does
-h, --helpShow help message and exit
-o, --outputOutput format: json, tsv, table, or yaml (default: json)
-q, --queryFilter output using JMESPath query syntax
--subscriptionSubscription ID or name to use for the command
-g, --resource-groupName of the resource group (used by many subcommands)
--debugEnable debug logging for troubleshooting
--verboseEnable verbose output
--versionShow the Azure CLI version

Examples

Authenticate to Azure using your browser; prompts for credentials

az login

List all virtual machines in the current subscription in table format

az vm list -o table

Create a new Ubuntu virtual machine named 'myvm' in resource group 'mygroup'

az vm create -g mygroup -n myvm --image UbuntuLTS

List all storage account names using JMESPath query, output as tab-separated values

az storage account list --query "[].name" -o tsv

Create a new resource group named 'myresourcegroup' in the East US region

az group create -n myresourcegroup -l eastus

Display the current logged-in user's name

az account show --query user.name -o tsv

Create a new web app named 'myapp' in the specified resource group and App Service plan

az webapp create -g mygroup -p myplan -n myapp

Display the installed Azure CLI version and dependent components

az --version

Related commands