| name | azure-cli |
| description | Azure CLI operations for cloud resource management. USE FOR: az login, az aks, az acr, az keyvault, Azure resource provisioning, Azure resource group, Azure subscription management. DO NOT USE FOR: Terraform IaC (use terraform-cli), Kubernetes operations (use kubectl-cli), Helm charts (use helm-cli). |
When to Use
- Azure resource queries
- AKS cluster management
- Key Vault operations
- ACR management
- RBAC configuration
Prerequisites
- Azure CLI installed
- Authenticated: az login or managed identity
- Subscription selected
- Appropriate RBAC roles
Commands
Context
az account show -o table
az account list -o table --query "[].{Name:name, ID:id, State:state}"
az account set --subscription "<subscription-id>"
Resource Queries
az resource list -g <resource-group> -o table
az resource show --ids <resource-id>
az resource list -g <rg> --query "[?type=='Microsoft.ContainerService/managedClusters']"
AKS Operations
az aks get-credentials -g <rg> -n <cluster> --overwrite-existing
az aks show -g <rg> -n <cluster> -o table
az aks nodepool list -g <rg> --cluster-name <cluster> -o table
az aks scale -g <rg> -n <cluster> --node-count 5
Key Vault
az keyvault secret list --vault-name <kv> -o table --query "[].{Name:name}"
az keyvault secret show --vault-name <kv> -n <secret> --query value -o tsv
ACR
az acr repository list -n <acr> -o table
az acr repository show-tags -n <acr> --repository <repo> --orderby time_desc
Best Practices
- Use -o table for readable output
- Use -o json for parsing with jq
- Use --query for filtering
- Never expose secrets in output
- Verify subscription before operations
Output Format
- Command executed
- Results in table format
- Warnings or issues
- Next steps
Integration with Agents
Used by: @terraform, @security, @sre, @azure-portal-deploy