Get started with the Azure Command-Line Interface to manage Azure resources.
Overview
The Azure Command-Line Interface (Azure CLI) is a powerful tool for managing Azure resources directly from your command line. It's available for Windows, macOS, and Linux. Follow the instructions below to install the Azure CLI on your system.
Why Use the Azure CLI?
Automate Azure deployments and management tasks.
Integrate Azure management into your scripts and CI/CD pipelines.
Access a wide range of Azure services.
Work efficiently with familiar command-line tools.
Choose Your Operating System
Select your operating system to find the specific installation instructions:
Windows
You can install the Azure CLI on Windows using several methods. The recommended method for most users is the MSI installer.
You can run the Azure CLI within a Docker container. This is useful for consistent environments or for scenarios where you don't want to install it directly on your host machine.
Pull the latest Azure CLI image:
docker pull mcr.microsoft.com/azure-cli
Run Azure CLI commands:
To run a command, use the following format:
docker run -it --rm mcr.microsoft.com/azure-cli <your_az_command>
For example, to check the version:
docker run -it --rm mcr.microsoft.com/azure-cli az --version
Interactive Session:
To start an interactive shell within the container:
docker run -it mcr.microsoft.com/azure-cli
You can then run az commands directly within this shell.
Once the Azure CLI is installed, you can log in to your Azure account using:
az login
This command will open a web browser for you to authenticate. After successful authentication, you can start using az commands to manage your Azure resources.