azure-cli

Guides authoring, reviewing, and debugging Azure CLI commands, scripts, and CI pipelines.

Updated Apr 11, 2026
One-click install
npx skills add https://github.com/lurodrisilva/personal-skills --skill azure-cli-lurodrisilva
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: azure-cli
Source: https://github.com/lurodrisilva/personal-skills/tree/main/platform-engineering/azure-cli
Command: npx skills add https://github.com/lurodrisilva/personal-skills --skill azure-cli-lurodrisilva

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams driving Azure through the az CLI repeatedly hit the same failures: long-lived service principal secrets committed to repos, scripts parsing -o table output, JMESPath predicates returning empty results from double-quoted strings, CI steps running against the wrong subscription, and sleep loops instead of proper waiters. This Skill encodes the full az contract — command grammar, identity-first authentication, output formats, JMESPath querying, configuration precedence, extensions, pagination, and CI hardening — so generated and reviewed az usage is reproducible, scoped, and secret-free. ## Core Features & Use Cases - Identity-first authentication playbook: managed identity for in-Azure compute, federated OIDC (azure/login@v2) for CI, certificate SPs as fallback, and least-privilege create-for-rbac scoping with --role and --scopes. - Output and query discipline: the seven output formats, client-side JMESPath --query rules (single-quoted strings, backtick literals, multiselect lists to pin tsv column order), and why -o table must never be parsed in scripts. - Operational mechanics: accounts/subscriptions/tenants, sovereign clouds (az cloud set before az login), two-tier config with AZURE_* env vars, extensions and dynamic install, --no-wait + az wait pollers, --ids @- batching, az rest, and the Azure MCP Server. - Read-only triage scripts: three bash tools (az-identity-check.sh, az-config-audit.sh, az-resource-inventory.sh) that snapshot identity, audit local config hygiene, and inventory resources without mutating anything. - Use Case: While reviewing a GitHub Actions workflow, flag a stored AZURE_CLIENT_SECRET, replace it with OIDC login, add --only-show-errors and telemetry-off settings, and rewrite a sleep 60 loop as az vm wait --created. ## Quick Start Ask the AI to review your shell script or GitHub Actions workflow that calls az commands and harden it for identity, output parsing, and CI use.

Frequently Asked Questions about azure-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I authenticate Azure CLI in GitHub Actions without secrets?▼

Use the azure/login@v2 action with OIDC federation: set permissions id-token: write, register a federated identity credential on the app or user-assigned managed identity matching the repo subject, and pass client-id, tenant-id, and subscription-id. No AZURE_CLIENT_SECRET is stored.

How to query Azure CLI output with JMESPath?▼

Pass a JMESPath expression via --query, which filters the returned JSON client-side before display. Use single-quoted strings in predicates like [?name=='web'], backtick literals for numbers, and multiselect lists [].[name,location,id] to pin column order for tsv output.

Why does my Azure CLI JMESPath filter return empty output?▼

Double quotes inside a JMESPath predicate cause empty output — write [?name=='web'], not [?name=="web"]. Also remember --query is case-sensitive (osProfile differs from OsProfile), and backtick literals need extra escaping in PowerShell and Cmd.

Should I parse az table output in scripts?▼

No. The table format silently drops nested objects and the id, type, and etag keys, and tsv has no key-order guarantee. Use -o json for jq parsing or -o tsv with a --query multiselect list to pin column order for shell capture.

How do I use Azure CLI with Azure Government or China clouds?▼

Run az cloud set --name AzureUSGovernment or AzureChinaCloud before az login. Sovereign clouds have distinct Entra login hosts, ARM endpoints, and DNS suffixes, so a public-cloud token is not valid against them.

When should I not use the Azure CLI for Azure automation?▼

Avoid az for authoring Bicep/ARM templates, Terraform azurerm resources, PowerShell Az module code, or language SDK work — those belong to their own tooling. Also delegate FinOps cost triage with az costmanagement or az graph to a dedicated cost discipline.