Azure CLI (az)
The Azure CLI is a unified tool to manage your Azure services from the command line.
Overview
Think of the Azure CLI as your command center for Azure. Instead of clicking through the Azure Portal website, you can manage everything by typing commands. This tool (often just called 'az') lets you:
- Create and manage all Azure resources from your terminal
- Automate repetitive tasks with scripts
- Query and filter resource information quickly
- Work faster than using the web interface
The Azure CLI is free, works on Windows, macOS, and Linux, and can even run in a browser through the Azure Cloud Shell. While the Azure Portal is great for learning and visualization, the CLI becomes essential when you need to automate tasks or manage resources efficiently.
Example uses
Resource Creation: Create a new web app with a single command:
az webapp create --name mywebapp --resource-group mygroup
Resource Querying: List all your virtual machines and their status:
az vm list --output table
Account Management: Switch between different Azure subscriptions:
az account set --subscription "My Production Subscription"
Resource Cleanup: Delete unused resources to save costs:
az group delete --name old-project-resources
Integration with other Azure services
The Azure CLI works with all major Azure services:
- Azure Virtual Machines: Create and manage VMs
- Azure Storage: Handle blob storage and file shares
- Azure App Service: Deploy and manage web applications
- Azure Kubernetes Service (AKS): Manage container orchestration
Any operation possible in the Azure Portal can typically be performed through the CLI, often more quickly and in a way that can be automated.
Similar services in other clouds
- GCP CLI (gcloud): Google Cloud Platform's command-line tool
- AWS CLI: Amazon Web Services' command-line interface
Documents
Setting up the Azure CLI
Access and manage Azure resources from the command line.