Azure CLI
$ az Official High RiskAzure CLI (az) manages Microsoft Azure subscriptions, AKS, Entra ID, and ARM deployments using consistent --output json (-o json) formatting, client-side JMESPath --query filtering, --only-show-errors, and --what-if dry-run previews on ARM template deployments.
brew install azure-cli az offers deterministic -o json + JMESPath --query across all Azure Resource Manager services, outperforming large MCP toolsets.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Uniform --output json, built-in JMESPath --query, --yes, and --only-show-errors provide strong machine-readability.
- Supports
-o json,--query(JMESPath), and--only-show-errorsglobally
Subscription isolation via --subscription, RBAC service principals, and --what-if on deployments help, though destructive deletes carry high impact.
- ARM deployments support
--what-if; destructive deletes require--yes
Distributed via Homebrew, pip, and OS packages on macOS, Linux, and Windows, though Python dependency weight slows installation.
- Official
azure-clipackages for Homebrew, apt, yum, MSI, and PyPI
Broad ARM coverage and --query filtering cut token volume substantially.
- Single CLI covers all Azure control-plane APIs
First-party Microsoft tool (Azure/azure-cli) with frequent scheduled releases.
- Official
Azure/azure-cliGitHub repository under MIT
Detailed --help examples and comprehensive Microsoft Learn reference pages.
- Consistent
--helpoutput and online command index
Security, Auth & Guardrails
Stores MSAL token cache and subscription context in ~/.azure/, or uses AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, and AZURE_TENANT_ID.
CLI is free (MIT); Azure deployments incur cloud subscription charges.
# Azure CLI Agent Rules - Always verify `az account show --output json` and pass `--subscription` explicitly. - Append `--output json --only-show-errors` and trim results with `--query`. - Use `--what-if` for `az deployment` runs; require human approval for `delete` or `purge`.
Agent-Ready Command Recipes
Safe Read-Only Queries
az account show --output json --only-show-errors
Confirms the active subscription ID and tenant before reading or modifying Azure resources.
az group list --output json --query '[].{name:name,location:location}' Projects only group name and location using --query to keep output compact.
Controlled Writes & Previews
--what-if az deployment group create --resource-group rg-app --template-file main.bicep --what-if
Computes resource creates, updates, and deletes without applying changes.
Strengths for Agents
- + Built-in JMESPath
--queryand--output jsonwork consistently across services. - +
az deployment ... --what-ifpreviews ARM and Bicep mutations safely. - +
--only-show-errorssuppresses noisy warning banners in automated runs.
Caveats & Pitfalls
- ! Python-based runtime has slower startup latency than compiled Go/Rust CLIs.
- !
--what-ifis limited to ARM/Bicep deployments rather than imperative resource commands.