| name | Azure API Management |
| description | Deep expertise in Azure API Management operations with deterministic runbooks, fail-fast context validation, and redacted output requirements.
|
| allowed-tools | ["Read","Write","Edit","Glob","Grep","Bash"] |
| triggers | ["apim","azure api management","api policy","api revision","api contract diff"] |
Azure API Management
Integration Context Contract
| Workflow | tenantId | subscriptionId | environmentCloud | principalType | scopesOrRoles |
|---|
| Azure API Management operations | required | required | AzureCloud* | service-principal or delegated-user | API Management Service Contributor, Reader |
- Use sovereign cloud values from the canonical contract when applicable.
Fail fast before API calls when required context is missing or malformed. Redact tenant, subscription, and object identifiers.
Command Surface
| Command | Purpose |
|---|
apim-setup | Deterministic workflow for apim setup. |
apim-api-inventory | Deterministic workflow for apim api inventory. |
apim-policy-drift | Deterministic workflow for apim policy drift. |
apim-secret-rotation | Deterministic workflow for apim secret rotation. |
apim-contract-diff | Deterministic workflow for apim contract diff. |
Guardrails
- Validate context schema and minimum grants before any API call.
- Run read-only discovery first whenever possible.
- Require explicit confirmation for destructive actions.
- Re-query and verify post-action state.
- Return structured, redacted output.
Azure CLI Reference
All commands below require Azure CLI (az) with an authenticated session (az login).
Use --output table for human-readable output or --output json for automation.
Instance Management
az apim create --name <name> --resource-group <rg> --publisher-email <email> --publisher-name <org> --sku-name Developer --location <region>
az apim show --name <name> --resource-group <rg>
az apim list --resource-group <rg> --output table
az apim delete --name <name> --resource-group <rg> --yes
az apim update --name <name> --resource-group <rg> --set sku.name=Standard
az apim check-name-availability --name <name>
az apim backup --name <name> --resource-group <rg> --storage-account-name <sa> --storage-account-container <container> --backup-name <backup>
az apim restore --name <name> --resource-group <rg> --storage-account-name <sa> --storage-account-container <container> --backup-name <backup>
API Management
az apim api import --resource-group <rg> --service-name <apim> --path <url-path> --specification-format OpenApi --specification-url <spec-url> --api-id <id> --display-name "<name>"
az apim api import --resource-group <rg> --service-name <apim> --path <url-path> --specification-format OpenApiJson --specification-path ./openapi.json --api-id <id>
az apim api create --resource-group <rg> --service-name <apim> --api-id <id> --display-name "<name>" --path <path> --protocols https --service-url <backend-url>
az apim api show --resource-group <rg> --service-name <apim> --api-id <id>
az apim api list --resource-group <rg> --service-name <apim> --output table
az apim api update --resource-group <rg> --service-name <apim> --api-id <id> --set description="Updated description"
az apim api delete --resource-group <rg> --service-name <apim> --api-id <id> --yes
az apim api revision create --resource-group <rg> --service-name <apim> --api-id <id> --api-revision <rev-num> --api-revision-description "Bug fix"
az apim api revision list --resource-group <rg> --service-name <apim> --api-id <id>
az apim api operation list --resource-group <rg> --service-name <apim> --api-id <id> --output table
az apim api operation show --resource-group <rg> --service-name <apim> --api-id <id> --operation-id <op-id>
Products
az apim product create --resource-group <rg> --service-name <apim> --product-id <id> --title "<title>" --description "<desc>" --subscription-required true --approval-required false --state published
az apim product show --resource-group <rg> --service-name <apim> --product-id <id>
az apim product list --resource-group <rg> --service-name <apim> --output table
az apim product update --resource-group <rg> --service-name <apim> --product-id <id> --set description="Updated"
az apim product delete --resource-group <rg> --service-name <apim> --product-id <id> --yes
az apim product api add --resource-group <rg> --service-name <apim> --product-id <prod-id> --api-id <api-id>
az apim product api list --resource-group <rg> --service-name <apim> --product-id <prod-id>
az apim product api delete --resource-group <rg> --service-name <apim> --product-id <prod-id> --api-id <api-id>
Subscriptions
az apim subscription create --resource-group <rg> --service-name <apim> --subscription-id <sub-id> --display-name "<name>" --scope "/products/<prod-id>"
az apim subscription show --resource-group <rg> --service-name <apim> --subscription-id <sub-id>
az apim subscription list --resource-group <rg> --service-name <apim> --output table
az apim subscription update --resource-group <rg> --service-name <apim> --subscription-id <sub-id> --set state=active
az apim subscription regenerate-primary-key --resource-group <rg> --service-name <apim> --subscription-id <sub-id>
az apim subscription regenerate-secondary-key --resource-group <rg> --service-name <apim> --subscription-id <sub-id>
Named Values (Secrets)
az apim nv create --resource-group <rg> --service-name <apim> --named-value-id <id> --display-name "<name>" --value "<value>" --secret true
az apim nv show --resource-group <rg> --service-name <apim> --named-value-id <id>
az apim nv list --resource-group <rg> --service-name <apim> --output table
az apim nv update --resource-group <rg> --service-name <apim> --named-value-id <id> --set value="new-value"
az apim nv delete --resource-group <rg> --service-name <apim> --named-value-id <id> --yes
Diagnostics and Monitoring
az apim api diagnostic create --resource-group <rg> --service-name <apim> --api-id <id> --diagnostic-id applicationinsights --logger-id <logger-id>
az apim logger create --resource-group <rg> --service-name <apim> --logger-id <id> --logger-type applicationInsights --credentials instrumentationKey=<key>
az apim logger list --resource-group <rg> --service-name <apim>
az apim logger delete --resource-group <rg> --service-name <apim> --logger-id <id>
Progressive Disclosure - Reference Files