Loading...
Loading...
Azure CLI (az). Use when: managing Azure resources, deploying to App Service/Functions/Container Apps/AKS, working with Storage, SQL Database, Cosmos DB, VMs, VNets, NSGs, Key Vault, Entra ID (Azure AD), RBAC, Service Bus, Event Hubs, Container Registry, Azure Monitor, DNS, or any Azure service. Also covers: authentication, subscription management, CI/CD integration (GitHub Actions/Azure DevOps), Bicep/ARM templates, managed identities, and infrastructure automation.
npx skill4agent add marcfargas/skills azcliazwinget install --exact --id Microsoft.AzureCLI~/.azure/az extension add --name NAMEaz versionaz upgrade--query# Git Bash — use single quotes for JMESPath
az vm list --query '[].name' -o tsv
# PowerShell — use single quotes or escaped double quotes
az vm list --query '[].name' -o tsv
# Avoid: Git Bash may mangle double-quoted JMESPath⚠️ Cost: Commands that create resources (VMs, databases, clusters) incur Azure charges. Always confirm subscription and region before creating.
| Level | Gate | Examples |
|---|---|---|
| READ | Proceed autonomously | |
| WRITE | Confirm with user; note cost if billable | |
| DESTRUCTIVE | Always confirm; show what's affected | |
| EXPENSIVE | Confirm + state approximate cost | AKS clusters ( |
| SECURITY | Confirm + explain impact | NSG rules opening ports, |
| FORBIDDEN | Refuse; escalate to human | |
--yes-o jsonaz [GROUP] [SUBGROUP] COMMAND [ARGS] [FLAGS]--subscription--output-o--query--verbose--debug--only-show-errors--yes| Service | File | Key Commands |
|---|---|---|
| Auth & Config | auth.md | Login, service principals, managed identities, subscriptions, config |
| IAM & Resources | iam.md | Resource groups, RBAC, Entra ID (Azure AD), Key Vault |
| Compute & Networking | compute.md | VMs, VNets, NSGs, DNS, load balancers, monitoring |
| Serverless & Containers | serverless.md | App Service, Functions, Container Apps, AKS, Container Registry |
| Storage | storage.md | Storage accounts, blobs, file shares, queues, tables |
| Data | data.md | SQL Database, Cosmos DB, Service Bus, Event Hubs |
| Automation & CI/CD | automation.md | Scripting, output formats, JMESPath, Bicep/ARM, GitHub Actions |
# 1. Logged in?
az account show -o json
# 2. Correct subscription?
az account show --query '{Name:name, Id:id, State:state}' -o json
# 3. Change subscription if needed
az account set --subscription "<name-or-id>"
# 4. Default location set?
az config get defaults.location 2>/dev/null
# 5. Set default location (optional)
az config set defaults.location=westeurope
# 6. Resource provider registered? (most are auto-registered)
az provider show --namespace Microsoft.ContainerApp --query "registrationState" -o tsv
az provider register --namespace Microsoft.ContainerApp --wait| Problem | Diagnosis | Fix |
|---|---|---|
| Auth failure | | |
| Permission denied | Check RBAC (see iam.md) | Grant correct role |
| Provider not registered | Error says which provider | |
| Quota exceeded | Error message | Request increase in Portal or |
| Wrong subscription | | |
| Wrong region | Check resource's | Recreate in correct region |
| Extension missing | | |
| Slow commands | Large result set | Use |
# Debug mode
az vm list --debug 2>&1 | head -50
# Full environment info
az version
az account show -o json| Task | Command |
|---|---|
| Login | |
| Set subscription | |
| Current subscription | |
| List subscriptions | |
| Register provider | |
| List anything | |
| Show anything | |
| JSON output | |
| TSV (single values) | |
| JMESPath query | |
| Suppress prompts ⚠️ | |
| Help | |
| Upgrade CLI | |