Azure CLI Global Options Guide | Generated by AI

Home 2026.02

Question: Provide a comprehensive introduction to Azure CLI command line options.

Answer:

The Azure CLI (az) is a cross-platform command-line tool for managing Azure resources. Almost every command supports a set of global arguments (also called global parameters or global options) that work across nearly all commands.

These global options are the most frequently used “command line options” when people talk about Azure CLI usage patterns.

Most Important Global Arguments (2026)

These arguments can be appended to almost any az command:

Argument Short Common values / Description Typical use case
--help -h Show help for the command / group Learn any command: az vm create -h
--output -o json (default), jsonc, table, tsv, yaml, yamlc, none Human-readable: --output table
Machine: --output json
--query   JMESPath expression Filter output: --query "[].{name:name, id:id}"
--subscription   Subscription name or ID Override default: --subscription "Prod Sub"
--verbose   Increase logging verbosity See more details during execution
--debug   Show all debug logs + low-level REST API calls Troubleshooting / deep debugging
--only-show-errors   Suppress warnings, show only errors Clean CI/CD output

Quick examples:

# Human-friendly table output
az resource list --output table

# Filter to only names and locations
az vm list --query "[].{Name:name, Location:location}" --output table

# Run command in a specific subscription
az group list --subscription "My-Dev-Sub" -o table

# Debug a failing command
az storage account create ... --debug

Other Useful Global / Frequently Encountered Options

Configuration that Affects Command-line Behavior

Many behaviors can be set once (instead of repeating flags every time) using:

# Interactive wizard (recommended for beginners)
az init

# Or set individual values
az config set core.output=table
az config set core.default_subscription="My-Sub-Name"
az config set logging.enable_log_file=true

Common config keys that influence command-line feel:

Positional vs Named Arguments

Azure CLI uses two styles:

Always prefer named arguments for clarity and script robustness.

Best Practices Summary (2026 style)

The full list of global parameters is shown when you run az --help or any command with --help.

References:


Back Donate