Install the Azure CLI
Quickly install the Azure Command-Line Interface (Azure CLI) to use a set of open-source shell-based commands for creating and managing resources in Microsoft Azure. You have several installation choices: use one of the provided installer packages for different operating systems, install from an npm package, or install the Azure CLI as a container in a Docker host. For more options and background, see the project repository on GitHub.
Once the Azure CLI has been installed, you will be able to connect it with your Azure subscription and run the azure commands from your command-line interface (Bash, Terminal, Command prompt, and so on) to work with your Azure resources.
The following installer packages are available:
Alternatively, if the latest Node.js and npm are already installed on your system, run the following command to install the Azure CLI package. (On Linux distributions, you might need to use sudo to successfully run the npm command.)
npm install azure-cli -g
If you need to install or update Node.js and npm for your operating system, see the documentation at Nodejs.org. We recommend that you install the most recent Node.js LTS version (4.x). If you use an older version, you might get installation errors.
In a Docker host, run:
docker run -it microsoft/azure-cli
Once the Azure CLI has been installed, you will be able to run the azure command from your command-line user interface (Bash, Terminal, Command prompt, and so on). For example, to run the help command, type the following:
To see the version of the Azure CLI you installed, type the following:
Now you are ready! For access to all of the CLI commands to work with your own resources, connect to your Azure subscription from the Azure CLI.
When you first use Azure CLI version 0.9.20 or later, you'll see a message asking if you want to allow Microsoft to collect information about how you use the CLI. Participation is voluntary. If you choose to participate, you can stop at any time by running
azure telemetry --disable. To enable participation at any time, run
azure telemetry --enable.
Microsoft frequently releases updated versions of the Azure CLI. Reinstall the CLI using the installer for your operating system or, if you have the latest Node.js and npm installed, update by typing the following (on Linux distributions you might need to use sudo).
npm update -g azure-cli
Connect from the CLI to your Azure subscription to create and manage Azure resources.
To learn more about the Azure CLI, download source code, report problems, or contribute to the project, visit the GitHub repository for the Azure CLI.
If you have questions about using the Azure CLI, or Azure, visit the Azure Forums.
For Linux systems, you can also install the Azure CLI by building it from the source. For more information on building from source, see the INSTALL file included in the source archive.