Azure Command-Line Interface (CLI)
The Azure command-line interface (CLI) is Microsoft's cross-platform command-line experience for managing Azure resources. Use it in your browser with Azure Cloud Shell, or install it on macOS, Linux, or Windows and run it from the command line.
The Azure CLI is easy to get started with, and best used for building automation scripts that work with the Azure Resource Manager. Using the Azure CLI, you can create VMs within Azure as easily as typing the following command:
az vm create -n MyLinuxVM -g MyResourceGroup --image UbuntuLTS
In scripts and on the Microsoft documentation site, Azure CLI examples are written for the
bash shell. One-line examples will
run on any platform. Longer examples which include line continuations (
\) or variable assignment need to be modified to work
on other shells, including PowerShell.
Run or Install
You can install the CLI locally, run it in the browser with Azure Cloud Shell, or run in a Docker container. To get the current version of the CLI, run
- To run in your browser with Azure Cloud Shell, see Quickstart for Bash in Azure Cloud Shell or Quickstart for PowerShell in Azure Cloud Shell.
- To install the CLI, see Install the Azure CLI.
- To run as a Docker container, see Run Azure CLI in a Docker Container
Build your skills with Microsoft Learn
- Manage virtual machines with the Azure CLI
- Control Azure services with the CLI
- More interactive learning...
Read the Get Started article to learn the CLI basics. The following samples demonstrate some common uses cases:
A detailed reference is also available that documents how to use each individual Azure CLI command.
If you use the previous version of the CLI (Azure classic CLI), you can continue to use it.
However, we recommend updating to use the latest version of the Azure CLI for the best experience.
If you use both CLIs, remember that
azure is the classic CLI and that
az is the most recent CLI.
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.