Azure CLI
Use this skill to turn Azure operations requests into ordered az command workflows, verify the active cloud context, and return resource, identity, AKS, ACR, Key Vault, RBAC, or subscription evidence without exposing secrets.
When to invoke
- "Check the current Azure subscription and account context."
- "Query Azure resources in a resource group."
- "Get AKS credentials or inspect an AKS cluster."
- "List Key Vault secret names or ACR repositories."
- "Configure or validate Azure RBAC, managed identity, or federated credentials."
Prerequisites and context
- Azure CLI installed.
- Authenticated with
az login or managed identity.
- Subscription selected.
- Appropriate RBAC roles.
Procedure
- Confirm authentication and subscription context before querying or changing Azure resources.
- Select the narrowest
az command for the requested resource type.
- Prefer readable table output for human review and JSON output when another tool will parse the result.
- Redact or avoid secret values in any returned output.
- Return the result using the output template.
Context
# Show current account
az account show -o table
# List subscriptions
az account list -o table --query "[].{Name:name, ID:id, State:state}"
# Set subscription
az account set --subscription "<subscription-id>"
Resource queries
# List resources in RG
az resource list -g <resource-group> -o table
# Show resource
az resource show --ids <resource-id>
# Query with JMESPath
az resource list -g <rg> --query "[?type=='Microsoft.ContainerService/managedClusters']"
AKS operations
# Get credentials
az aks get-credentials -g <rg> -n <cluster> --overwrite-existing
# Show cluster
az aks show -g <rg> -n <cluster> -o table
# Node pools
az aks nodepool list -g <rg> --cluster-name <cluster> -o table
# Scale cluster
az aks scale -g <rg> -n <cluster> --node-count 5
Key Vault
# List secrets (names only)
az keyvault secret list --vault-name <kv> -o table --query "[].{Name:name}"
# Get secret
az keyvault secret show --vault-name <kv> -n <secret> --query value -o tsv
ACR
# List repositories
az acr repository list -n <acr> -o table
# Show tags
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 template
Return exactly this structure:
**Status:** PASS | FAIL | BLOCKED
**Summary:** One sentence describing the Azure resource, identity, AKS, ACR, Key Vault, or subscription outcome.
### Details
1. Command executed: `<az command>`
2. Subscription context: `<subscription name or ID>`
3. Target resource: `<resource group, resource ID, AKS cluster, ACR, Key Vault, or not applicable>`
4. Results: `<table summary, JSON summary, or operation result>`
5. Warnings or issues: `<RBAC, context, secret-handling, or none>`
6. Next steps: `<next Azure action or none>`
### Validation
- Context check: `<az account show evidence or reason not checked>`
- Command result: `<exit code or observed az output>`
Limits
- Do not use this skill for Terraform IaC.
- Use
terraform-cli (skill) instead when the task is Terraform init, plan, apply, validate, fmt, state, import, module development, provider locks, tfvars, or tfsec scanning.
- Do not use this skill for Azure architecture patterns.
- Use
azure-infrastructure (skill) instead when the task is architecture design, hub-spoke networking, private endpoints, Workload Identity patterns, naming, or tagging strategy.
- Do not use this skill for Kubernetes kubectl commands.
- Use
kubectl-cli (skill) instead when the task is direct Kubernetes resource inspection, logs, rollout status, events, or manifests.
- Do not use this skill for Helm charts.
- Use
helm-cli (skill) instead when the task is chart repositories, values, templates, releases, upgrades, or rollbacks.
Progressive disclosure and bundled resources
scripts/setup-identity-federation.sh: use when the Azure task requires identity federation setup automation.
Related primitives
| Name |
Type |
Use it when |
open-horizons-terraform |
agent |
Planning or implementing Terraform-based Azure infrastructure changes. |
open-horizons-security-reviewer |
agent |
Reviewing Azure RBAC, identity, or secret-handling risk. |
open-horizons-sre-investigator |
agent |
Diagnosing Azure-side operational issues for running services. |
open-horizons-azure-readiness |
agent |
Validating Azure subscription, provider, quota, and resource readiness. |
terraform-cli |
skill |
Managing infrastructure through Terraform rather than direct az commands. |
kubectl-cli |
skill |
Inspecting Kubernetes resources after AKS credentials are configured. |
azure-infrastructure |
skill |
Designing Azure architecture patterns before CLI execution. |
Quality gate
1---2name: azure-cli-53description: Azure CLI operations run az commands for cloud resource discovery, subscription context, identity, AKS, ACR, Key Vault, RBAC, managed identity, and federated credential workflows. Use this skill when working with az login, az account, az aks, az acr, az keyvault, resource group checks, or Azure day-2 operations.4---56# Azure CLI78Use this skill to turn Azure operations requests into ordered `az` command workflows, verify the active cloud context, and return resource, identity, AKS, ACR, Key Vault, RBAC, or subscription evidence without exposing secrets.910## When to invoke1112- "Check the current Azure subscription and account context."13- "Query Azure resources in a resource group."14- "Get AKS credentials or inspect an AKS cluster."15- "List Key Vault secret names or ACR repositories."16- "Configure or validate Azure RBAC, managed identity, or federated credentials."1718## Prerequisites and context1920- Azure CLI installed.21- Authenticated with `az login` or managed identity.22- Subscription selected.23- Appropriate RBAC roles.2425## Procedure26271. Confirm authentication and subscription context before querying or changing Azure resources.282. Select the narrowest `az` command for the requested resource type.293. Prefer readable table output for human review and JSON output when another tool will parse the result.304. Redact or avoid secret values in any returned output.315. Return the result using the output template.3233### Context3435```bash36# Show current account37az account show -o table3839# List subscriptions40az account list -o table --query "[].{Name:name, ID:id, State:state}"4142# Set subscription43az account set --subscription "<subscription-id>"44```4546### Resource queries4748```bash49# List resources in RG50az resource list -g <resource-group> -o table5152# Show resource53az resource show --ids <resource-id>5455# Query with JMESPath56az resource list -g <rg> --query "[?type=='Microsoft.ContainerService/managedClusters']"57```5859### AKS operations6061```bash62# Get credentials63az aks get-credentials -g <rg> -n <cluster> --overwrite-existing6465# Show cluster66az aks show -g <rg> -n <cluster> -o table6768# Node pools69az aks nodepool list -g <rg> --cluster-name <cluster> -o table7071# Scale cluster72az aks scale -g <rg> -n <cluster> --node-count 573```7475### Key Vault7677```bash78# List secrets (names only)79az keyvault secret list --vault-name <kv> -o table --query "[].{Name:name}"8081# Get secret82az keyvault secret show --vault-name <kv> -n <secret> --query value -o tsv83```8485### ACR8687```bash88# List repositories89az acr repository list -n <acr> -o table9091# Show tags92az acr repository show-tags -n <acr> --repository <repo> --orderby time_desc93```9495### Best practices96971. Use -o table for readable output.982. Use -o json for parsing with jq.993. Use --query for filtering.1004. Never expose secrets in output.1015. Verify subscription before operations.102103## Output template104105Return exactly this structure:106107```markdown108**Status:** PASS | FAIL | BLOCKED109**Summary:** One sentence describing the Azure resource, identity, AKS, ACR, Key Vault, or subscription outcome.110111### Details1121. Command executed: `<az command>`1132. Subscription context: `<subscription name or ID>`1143. Target resource: `<resource group, resource ID, AKS cluster, ACR, Key Vault, or not applicable>`1154. Results: `<table summary, JSON summary, or operation result>`1165. Warnings or issues: `<RBAC, context, secret-handling, or none>`1176. Next steps: `<next Azure action or none>`118119### Validation120- Context check: `<az account show evidence or reason not checked>`121- Command result: `<exit code or observed az output>`122```123124## Limits125126- Do not use this skill for Terraform IaC.127- Use `terraform-cli` (`skill`) instead when the task is Terraform init, plan, apply, validate, fmt, state, import, module development, provider locks, tfvars, or tfsec scanning.128- Do not use this skill for Azure architecture patterns.129- Use `azure-infrastructure` (`skill`) instead when the task is architecture design, hub-spoke networking, private endpoints, Workload Identity patterns, naming, or tagging strategy.130- Do not use this skill for Kubernetes kubectl commands.131- Use `kubectl-cli` (`skill`) instead when the task is direct Kubernetes resource inspection, logs, rollout status, events, or manifests.132- Do not use this skill for Helm charts.133- Use `helm-cli` (`skill`) instead when the task is chart repositories, values, templates, releases, upgrades, or rollbacks.134135## Progressive disclosure and bundled resources136137- `scripts/setup-identity-federation.sh`: use when the Azure task requires identity federation setup automation.138139## Related primitives140141| Name | Type | Use it when |142| --- | --- | --- |143| `open-horizons-terraform` | `agent` | Planning or implementing Terraform-based Azure infrastructure changes. |144| `open-horizons-security-reviewer` | `agent` | Reviewing Azure RBAC, identity, or secret-handling risk. |145| `open-horizons-sre-investigator` | `agent` | Diagnosing Azure-side operational issues for running services. |146| `open-horizons-azure-readiness` | `agent` | Validating Azure subscription, provider, quota, and resource readiness. |147| `terraform-cli` | `skill` | Managing infrastructure through Terraform rather than direct `az` commands. |148| `kubectl-cli` | `skill` | Inspecting Kubernetes resources after AKS credentials are configured. |149| `azure-infrastructure` | `skill` | Designing Azure architecture patterns before CLI execution. |150151## Quality gate152153- [ ] `name` is `azure-cli` and matches the parent directory.154- [ ] The active subscription is verified before resource operations.155- [ ] Secret values are not exposed in the response unless the user explicitly requested retrieval and the value is handled safely.156- [ ] `--query` or output mode choices are reported when they materially affect the result.157- [ ] AKS, ACR, and Key Vault commands include the target resource name or resource group when applicable.158- [ ] The bundled script path listed above exists before referring to it.