agentleFS
marcfargasmarcfargas/skills/azcli/SKILL.md

azcli

Skill4 starsChanged 9 months agoMITView on GitHub

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.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After install/update: close and reopen terminal — required for PATH

    line 22
  2. Distinctive:

    Before working with any Azure service:

    line 89

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

azcli — Azure Command-Line Interface

Command-line interface for managing Azure resources. Covers az and its 200+ command groups for all Azure services.

Docs: https://learn.microsoft.com/en-us/cli/azure/

Platform Notes (Windows + Git Bash)

  • Install: winget install --exact --id Microsoft.AzureCLI (preferred) or MSI from https://aka.ms/installazurecliwindows
  • After install/update: close and reopen terminal — required for PATH
  • Config: ~/.azure/ (credentials, config, profiles)
  • Secrets: use Key Vault or env vars, never commit credentials
  • Extensions: az extension add --name NAME (some features require extensions)
  • Version: az version (check for updates: az upgrade)

⚠️ Quoting Gotchas

Git Bash, PowerShell, and cmd have different quoting rules for --query (JMESPath):

# 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.

Agent Safety Model

Operations classified by risk. Follow this model for all az commands.

LevelGateExamples
READProceed autonomouslylist, show, get, account show, monitor log-analytics query
WRITEConfirm with user; note cost if billablecreate, deploy, update, az storage blob upload
DESTRUCTIVEAlways confirm; show what's affecteddelete, purge, az group delete, RBAC removal
EXPENSIVEConfirm + state approximate costAKS clusters ($70+/mo), SQL Database ($5-2k/mo), VMs (~$5-2k/mo)
SECURITYConfirm + explain impactNSG rules opening ports, --allow-unauthenticated, RBAC owner/contributor grants, Key Vault access policies
FORBIDDENRefuse; escalate to humanaz ad app credential reset with plaintext secrets, az group delete on production RGs, passwords in CLI args

Rules:

  • Never combine --yes with destructive operations — it suppresses the only safety gate
  • Never put passwords/secrets as command-line arguments — visible in process list & shell history
  • Always use -o json for machine-parseable output (agents can't reliably parse tables)
  • When in doubt, treat as DESTRUCTIVE

Command Structure

az [GROUP] [SUBGROUP] COMMAND [ARGS] [FLAGS]

Key global flags: --subscription, --output (-o), --query, --verbose, --debug, --only-show-errors, --yes

Service Reference

ServiceFileKey Commands
Auth & Configauth.mdLogin, service principals, managed identities, subscriptions, config
IAM & Resourcesiam.mdResource groups, RBAC, Entra ID (Azure AD), Key Vault
Compute & Networkingcompute.mdVMs, VNets, NSGs, DNS, load balancers, monitoring
Serverless & Containersserverless.mdApp Service, Functions, Container Apps, AKS, Container Registry
Storagestorage.mdStorage accounts, blobs, file shares, queues, tables
Datadata.mdSQL Database, Cosmos DB, Service Bus, Event Hubs
Automation & CI/CDautomation.mdScripting, output formats, JMESPath, Bicep/ARM, GitHub Actions

Read the per-service file for full command reference.

Pre-Flight Checks

Before working with any Azure service:

# 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

Troubleshooting

ProblemDiagnosisFix
Auth failureaz account showaz login or check service principal
Permission deniedCheck RBAC (see iam.md)Grant correct role
Provider not registeredError says which provideraz provider register --namespace Microsoft.X
Quota exceededError messageRequest increase in Portal or az quota
Wrong subscriptionaz account showaz account set --subscription X
Wrong regionCheck resource's locationRecreate in correct region
Extension missingaz extension listaz extension add --name NAME
Slow commandsLarge result setUse --query, --top, or --output tsv
# Debug mode
az vm list --debug 2>&1 | head -50

# Full environment info
az version
az account show -o json

Quick Reference

TaskCommand
Loginaz login
Set subscriptionaz account set --subscription "NAME_OR_ID"
Current subscriptionaz account show -o json
List subscriptionsaz account list -o table
Register provideraz provider register --namespace Microsoft.X
List anythingaz RESOURCE list -o json
Show anythingaz RESOURCE show --name NAME -g RG -o json
JSON output-o json
TSV (single values)-o tsv
JMESPath query--query "expression"
Suppress prompts ⚠️--yes — suppresses ALL confirmations
Helpaz RESOURCE --help or az find "search term"
Upgrade CLIaz upgrade

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.