Edit

Share via


Azure CLI onboarding cheat sheet

Ready to get started with the Azure CLI? This page provides essential tips and techniques to help you onboard quickly and begin using the Azure CLI with confidence.

Content indexes

Quickly access reference commands, sample scripts, and tutorials using these links:

Getting started

Question Answer Learn more
What advantage is there to using Azure CLI? You can manage multiple Azure resources concurrently from a flexible command-line. For example, create 50 Azure storage accounts, or update multiple user permissions through a script. Choose the right command-line tool
Where can I run the Azure CLI? The Azure CLI runs in Windows (PowerShell or Cmd), Linux, macOS, Docker containers, and Azure Cloud Shell. Using Azure Cloud Shell is the quickest way to get started. Run Azure Cloud Shell
Do I have to install the Azure CLI? Azure Cloud Shell and some Linux distributions have Azure CLI preinstalled. For all other environments, you must install the Azure CLI. Install the Azure CLI
How do I run the Azure CLI in a Docker container? docker run -it mcr.microsoft.com/azure-cli How to run the Azure CLI in a Docker container
What URLs do I need for proxy bypass? This depends on the Cloud you're using. For a complete list, see the list of endpoints needed for proxy bypass. Azure CLI endpoints for proxy bypass
How do I sign in? Use az login inside your console window. Use your Azure username and password, a service principal, managed identity, or WAM. Sign in with Azure CLI

Using reference commands

Question Answer Learn more
What is the Azure CLI syntax pattern? "<command group> + <command subgroup> + <command> + --parameters" Example: az storage account create --name myStorageAccount Azure CLI syntax components.
What is the difference between a command group, cmdlet, command, alias, module, and reference? The Azure CLI only has command groups, reference commands, and user-defined aliases. You might be thinking of Azure PowerShell if you're looking for cmdlets and modules. Azure CLI syntax components.
What is an extension and why does it have to be installed separately? Extensions are command group add-ins that aren't shipped as part of the core Azure CLI. You're prompted to install an extension the first time you use it. Get a list of available extensions by running az extension list-available --output table. Use and manage extensions with the Azure CLI
How do I get a list of all commands, both core and extension? For a list of command groups, in your console type az and Enter. For a list of subgroups and commands, use the --help parameter. Example: az account --help or az account subscription --help outputs a command list for just the group or subgroup. Reference index A-Z
Does the Azure CLI have tab completion? When typing a command in PowerShell, press Tab. This feature is only available in PowerShell. Enable Tab Completion on PowerShell
How do I get in-line help? Every command has a --help parameter that results in descriptions and tips to display in your console. Example: az account --help or az vm create --help You can also Request support.
How can I learn to use multiple reference commands to complete a single job to be done? The Azure CLI provides several interactive commands that provide syntax and next steps. In the next section, learn about az interactive, az scenario, az next, and az find. Learning Azure CLI

For a side-by-side comparison of Azure CLI and Azure PowerShell syntax, see Azure CLI vs Azure PowerShell: Side-by-side Command Comparison.

See script comparisons between Bash, PowerShell, and Cmd in Learn Azure CLI syntax differences in Bash, PowerShell, and Cmd.

Learning Azure CLI

The Learn to use the Azure CLI tutorial walks you through several common Azure CLI tasks with examples in Bash, PowerShell, and Cmd. Here are some skills covered while working with Azure Storage:

There are also several reference commands that offer interactive prompts to help you learn the Azure CLI.

Command Description Example
az interactive In a PowerShell console, get autocompletion, command descriptions, and examples as you type. See Work in interactive mode for more information. Example: Type az interactive in your console window then Enter.
az scenario Get end-to-end (E2E) examples and execute them with walk-through prompts. Type az scenario guide "keywords of interest" in your console then Enter. The Azure CLI returns scenarios based on your keywords. Example: az scenario guide "virtual machines"
az next Get recommendations for the next Azure CLI command based on customer execution patterns. You're prompted to select a command path. Type az next in your console then Enter. Pick from 1 of 7 preset command paths.
az find This is an AI robot that returns reference examples for keywords. Type az find "active subscription" in your console then Enter.

Another way to learn to use the Azure CLI is through Microsoft Training Modules for Azure CLI. The module provides a sandbox environment. Use it to try new commands without incurring costs.

Common usage questions

Question Reference command answer Learn more
How do I know what subscription I'm using? az account show --output table How to manage Azure subscriptions with the Azure CLI
How do I change my subscription? az account set --subscription "mySubscriptionName" How to manage Azure subscriptions with the Azure CLI
How can I set a default resource group and location? az config set defaults.location=westus2 defaults.group=MyResourceGroup Configure settings using az config
How do I query command output? az account show --query "{tenantId:tenantId,subscriptionid:id}" See How to query Azure CLI command output using a JMESPath query for --query examples in Bash, PowerShell, and Cmd.
How do I format output from a command? az account list --output table Output formats for Azure CLI commands
Can you help me to learn Bash with Azure CLI commands? We all have different technical strengths, and for that reason, Microsoft offers a How-to guide for learning Bash. Learn to use Bash with the Azure CLI