Azure CLI is a cross-platform tool that simplifies managing Azure resources from the command line.
Optimized for automation and ease of use, it supports interactive sessions and scripting with
straightforward commands that integrate seamlessly with the Azure Resource Manager model. You can
start using it in your browser with Azure Cloud Shell or install it locally to use
from your preferred terminal.
Install or run in Azure Cloud Shell
The easiest way to try Azure CLI is through Azure Cloud Shell, a
browser-based shell with no installation required. Cloud Shell supports Bash and PowerShell and
comes with the latest version of Azure CLI preinstalled.
If no web browser is available or the web browser fails to open, you can force device code flow
with az login --use-device-code.
Sign in with your account credentials in the browser.
Important
Starting in 2025, Microsoft will enforce mandatory MFA for Azure CLI and other command-line tools. MFA will only impact Microsoft Entra ID user identities.
It will not impact workload identities, such as service principals
and managed identities.
After you sign in, a list of your subscriptions appears. The one marked isDefault: true is
currently active. To change to a different subscription, run:
Azure CLI commands are organized as command groups. Each group represents an area of an Azure
service. There are two options to find command groups:
Use the az find command. For example, to search for command names containing vm, use
the following example:
az find vm
Use the --help argument to get a complete list of subgroups within a reference group. The
following example returns all subgroups for virtual machines:
az vm --help
The following example shows the relevant portion of the output.
Subgroups:
application : Manage applications for VM.
availability-set : Group resources into availability sets.
boot-diagnostics : Troubleshoot the startup of an Azure Virtual Machine.
...
The help output includes subgroups, parameters, authentication options, and examples.
Here's another example that finds the Azure CLI commands for grouping virtual machines into
availability sets, a subgroup of az vm:
az vm availability-set --help
You can also use --help to get parameter lists and command examples for a reference command.
az vm create --help
Here is the relevant section of the example output:
Arguments
--name [Required] : Name of the virtual machine.
...
Authentication Arguments
--admin-password : Password for the VM if authentication type is 'Password'.
--admin-username : Username for the VM...
...
Managed Service Identity Arguments
...
Examples
Create a VM from a custom managed image.
az vm create -g MyResourceGroup -n MyVm --image MyImage
...
Use the reference index that lists all command groups alphabetically.
The Article index to find in-depth guides. Use your keyboard find shortcut
keys, like Ctrl + F, to quickly find the reference command group in which you're interested. For
example, the article index for az vm looks like the following table:
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Azure CLI
feedback
Azure CLI
is an open source project. Select a link to provide feedback: