Azure CLI
The Azure CLI is a cross-platform command-line tool for managing Azure resources. This guide covers 2025 best practices, installation on Linux/WSL/NixOS, real-life DevOps scenarios, LLM integration, a
2025 Best Practices
Installation
Linux (Ubuntu/Debian/Fedora/Arch)
# Ubuntu/Debian
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
# Fedora
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo dnf install -y https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm
sudo dnf install azure-cli
# Arch Linux
yay -S azure-cliNixOS
Windows Subsystem for Linux (WSL)
Docker/Podman
Windows
Authentication & Profile Management
Login
List and Set Subscriptions
Named Profiles (2025+)
Using .envrc and direnv for Environment Isolation
Real-Life Scenarios
1. Provision a VM with Terraform and az CLI
2. Automate AKS Authentication and kubectl Context
3. Use az CLI with GitHub Copilot or Claude
4. Multi-Cloud/Hybrid Automation
Authenticating Against AKS and Other Services
AKS
Azure Container Registry (ACR)
Azure Key Vault
Useful Resources
Last updated