Operates Azure API Management gateways end-to-end: provisioning service tiers, importing OpenAPI definitions, applying policies (rate limit, CORS, transformation), managing subscription keys, and validating gateway routing with live curl calls.
Agentic Workflow: Read -> Reason -> Act (azure-api-management)
You are Azure Api Management (api/general) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — api context for azure-api-management
- Domain: Operates Azure API Management gateways end-to-end: provisioning service tiers, importing OpenAPI definitions, applying policies (rate limit, CORS, transformation), managing subscription keys, and vali
- apim-service: Create and manage API Management instances. —
az apim create --name my-apim --resource-group api-rg --publisher-email admin@co
- api-import: Import and manage APIs in APIM. —
az apim api import --service-name my-apim -g api-rg --api-id petstore --path pet
- subscriptions: Manage subscriptions and keys. —
az apim subscription list --service-name my-apim -g api-rg
- Check
knowledge references before acting
2. Reason — think for azure-api-management
- For
apim-service: Create and manage API Management instances. — decide which checks to run
- For
api-import: Import and manage APIs in APIM. — decide which checks to run
- For
subscriptions: Manage subscriptions and keys. — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with azure-api-management tools
- Tools:
Glob, Grep, Read, Az, Bash (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
azure-api-management:8df12e4b
Azure API Management
What this skill does
Operates Azure API Management gateways end-to-end: provisioning service tiers, importing OpenAPI definitions, applying policies (rate limit, CORS, transformation), managing subscription keys, and validating gateway routing with live curl calls.
When to use
- Exposing a backend API with rate limits, caching, or transformation
- Importing an OpenAPI spec to generate the gateway surface
- Issuing and rotating subscription keys
Real commands
# Create a service
az apim create --name my-apim --resource-group api-rg --publisher-email admin@contoso.com --publisher-name Contoso --sku-name Consumption
# Import an OpenAPI spec
az apim api import --service-name my-apim -g api-rg --api-id petstore --path petstore --specification-format OpenApiJson --specification-path ./openapi.json
# List operations
az apim api operation list --service-name my-apim -g api-rg --api-id petstore --query '[].{method:method,url:urlTemplate}' -o table
# Subscription
az apim subscription create --service-name my-apim -g api-rg --name svc-key --owner-id svc-account --scope /apis
# Call through the gateway
curl -s -H "Ocp-Apim-Subscription-Key: $KEY" https://my-apim.azure-api.net/petstore/pets
Testing
- Import then immediately list operations to verify the spec parsed
- Call the gateway URL with and without a key (401 without)
Best practices
- Use Consumption/Developer tier for dev; Premium for production SLAs
- Set policies (rate limit, CORS) per API or product
- Rotate keys via regenerate-primary-key on a schedule
Capabilities
apim-service
Create and manage API Management instances.
Parameters:
sku (string): Consumption, Developer, Basic, Standard, Premium
publisher_email (string): Publisher email
Commands:
az apim create --name my-apim --resource-group api-rg --publisher-email admin@contoso.com --publisher-name Contoso --sku-name Consumption
az apim show --name my-apim -g api-rg
az apim list --resource-group api-rg
az apim delete --name my-apim -g api-rg --yes
az apim list-skus
Examples:
- az apim create --name my-apim --resource-group api-rg --publisher-email admin@contoso.com --publisher-name Contoso --sku-name Developer
- az apim show --name my-apim -g api-rg --query 'gatewayUrl' -o tsv
- az apim list --resource-group api-rg --query '[].{name:name,sku:sku.name}' -o table
api-import
Import and manage APIs in APIM.
Parameters:
api_id (string): API identifier
path (string): URL path suffix
spec_file (string): OpenAPI spec file or URL
Commands:
az apim api import --service-name my-apim -g api-rg --api-id petstore --path petstore --specification-format OpenApiJson --specification-path ./openapi.json
az apim api list --service-name my-apim -g api-rg
az apim api show --service-name my-apim -g api-rg --api-id petstore
az apim api operation list --service-name my-apim -g api-rg --api-id petstore
az apim api update --service-name my-apim -g api-rg --api-id petstore --display-name "Pet Store v2"
Examples:
- az apim api import --service-name my-apim -g api-rg --api-id petstore --path petstore --specification-format OpenApiJson --specification-url https://httpbin.org/openapi.json
- az apim api operation list --service-name my-apim -g api-rg --api-id petstore --query '[].{method:method,url:urlTemplate}' -o table
- az apim api list --service-name my-apim -g api-rg --query '[].{id:name,path:path}' -o table
subscriptions
Manage subscriptions and keys.
Parameters:
subscription_name (string): Subscription name
scope (string): Scope: /apis, /apis/{api}, /products
owner_id (string): Owner user/group id
Commands:
az apim subscription list --service-name my-apim -g api-rg
az apim subscription create --service-name my-apim -g api-rg --name svc-key --owner-id svc-account --scope /apis
az apim subscription show --service-name my-apim -g api-rg --subscription-id sub-12345
az apim subscription regenerate-primary-key --service-name my-apim -g api-rg --subscription-id sub-12345
curl -s -H "Ocp-Apim-Subscription-Key: $SUBSCRIPTION_KEY" https://my-apim.azure-api.net/petstore/pets
Examples:
- az apim subscription create --service-name my-apim -g api-rg --name svc-key --owner-id svc-account --scope /apis --primary-key $(openssl rand -hex 16)
- az apim subscription regenerate-secondary-key --service-name my-apim -g api-rg --subscription-id sub-12345
- curl -s -H "Ocp-Apim-Subscription-Key: $KEY" https://my-apim.azure-api.net/petstore/pets?limit=5
References
1---2name: "azure-api-management"3description: "Operates Azure API Management gateways end-to-end: provisioning service tiers, importing OpenAPI definitions, applying policies (rate limit, CORS, transformation), managing subscription keys, and validating gateway routing with live curl calls. Use when working with apim service, api import, subscriptions or when the user mentions apim service, api import, subscriptions."4license: "MIT"5compatibility: "Requires network access."6metadata:7 source: https://skillmd.com/skills/opknock/azure-api-management8 author: Kdesk9 version: 2.0.010 category: api11allowed-tools: "Glob Grep Read Bash(az:*) Bash(curl:*)"12---1314Operates Azure API Management gateways end-to-end: provisioning service tiers, importing OpenAPI definitions, applying policies (rate limit, CORS, transformation), managing subscription keys, and validating gateway routing with live curl calls.1516## Agentic Workflow: Read -> Reason -> Act (azure-api-management)1718You are **Azure Api Management** (api/general) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — api context for `azure-api-management`21- Domain: Operates Azure API Management gateways end-to-end: provisioning service tiers, importing OpenAPI definitions, applying policies (rate limit, CORS, transformation), managing subscription keys, and vali22- **apim-service**: Create and manage API Management instances. — `az apim create --name my-apim --resource-group api-rg --publisher-email admin@co`23- **api-import**: Import and manage APIs in APIM. — `az apim api import --service-name my-apim -g api-rg --api-id petstore --path pet`24- **subscriptions**: Manage subscriptions and keys. — `az apim subscription list --service-name my-apim -g api-rg`25- Check `knowledge` references before acting2627### 2. Reason — think for `azure-api-management`28- For `apim-service`: Create and manage API Management instances. — decide which checks to run29- For `api-import`: Import and manage APIs in APIM. — decide which checks to run30- For `subscriptions`: Manage subscriptions and keys. — decide which checks to run31- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3233### 3. Act — execute with `azure-api-management` tools34- Tools: `Glob`, `Grep`, `Read`, `Az`, `Bash` (see frontmatter `tools`/`allowed-tools`)35- Use `safe_path` for any write; record evidence (paths, checksums)36- Fingerprint: `azure-api-management:8df12e4b`3738# Azure API Management3940## What this skill does4142Operates Azure API Management gateways end-to-end: provisioning service tiers, importing OpenAPI definitions, applying policies (rate limit, CORS, transformation), managing subscription keys, and validating gateway routing with live curl calls.4344## When to use4546- Exposing a backend API with rate limits, caching, or transformation47- Importing an OpenAPI spec to generate the gateway surface48- Issuing and rotating subscription keys4950## Real commands5152```bash53# Create a service54az apim create --name my-apim --resource-group api-rg --publisher-email admin@contoso.com --publisher-name Contoso --sku-name Consumption5556# Import an OpenAPI spec57az apim api import --service-name my-apim -g api-rg --api-id petstore --path petstore --specification-format OpenApiJson --specification-path ./openapi.json5859# List operations60az apim api operation list --service-name my-apim -g api-rg --api-id petstore --query '[].{method:method,url:urlTemplate}' -o table6162# Subscription63az apim subscription create --service-name my-apim -g api-rg --name svc-key --owner-id svc-account --scope /apis6465# Call through the gateway66curl -s -H "Ocp-Apim-Subscription-Key: $KEY" https://my-apim.azure-api.net/petstore/pets67```6869## Testing7071- Import then immediately list operations to verify the spec parsed72- Call the gateway URL with and without a key (401 without)7374## Best practices7576- Use Consumption/Developer tier for dev; Premium for production SLAs77- Set policies (rate limit, CORS) per API or product78- Rotate keys via regenerate-primary-key on a schedule7980## Capabilities8182### apim-service83Create and manage API Management instances.8485**Parameters:**86- `sku` (string): Consumption, Developer, Basic, Standard, Premium87- `publisher_email` (string): Publisher email8889**Commands:**90- `az apim create --name my-apim --resource-group api-rg --publisher-email admin@contoso.com --publisher-name Contoso --sku-name Consumption`91- `az apim show --name my-apim -g api-rg`92- `az apim list --resource-group api-rg`93- `az apim delete --name my-apim -g api-rg --yes`94- `az apim list-skus`9596**Examples:**97- az apim create --name my-apim --resource-group api-rg --publisher-email admin@contoso.com --publisher-name Contoso --sku-name Developer98- az apim show --name my-apim -g api-rg --query 'gatewayUrl' -o tsv99- az apim list --resource-group api-rg --query '[].{name:name,sku:sku.name}' -o table100101### api-import102Import and manage APIs in APIM.103104**Parameters:**105- `api_id` (string): API identifier106- `path` (string): URL path suffix107- `spec_file` (string): OpenAPI spec file or URL108109**Commands:**110- `az apim api import --service-name my-apim -g api-rg --api-id petstore --path petstore --specification-format OpenApiJson --specification-path ./openapi.json`111- `az apim api list --service-name my-apim -g api-rg`112- `az apim api show --service-name my-apim -g api-rg --api-id petstore`113- `az apim api operation list --service-name my-apim -g api-rg --api-id petstore`114- `az apim api update --service-name my-apim -g api-rg --api-id petstore --display-name "Pet Store v2"`115116**Examples:**117- az apim api import --service-name my-apim -g api-rg --api-id petstore --path petstore --specification-format OpenApiJson --specification-url https://httpbin.org/openapi.json118- az apim api operation list --service-name my-apim -g api-rg --api-id petstore --query '[].{method:method,url:urlTemplate}' -o table119- az apim api list --service-name my-apim -g api-rg --query '[].{id:name,path:path}' -o table120121### subscriptions122Manage subscriptions and keys.123124**Parameters:**125- `subscription_name` (string): Subscription name126- `scope` (string): Scope: /apis, /apis/{api}, /products127- `owner_id` (string): Owner user/group id128129**Commands:**130- `az apim subscription list --service-name my-apim -g api-rg`131- `az apim subscription create --service-name my-apim -g api-rg --name svc-key --owner-id svc-account --scope /apis`132- `az apim subscription show --service-name my-apim -g api-rg --subscription-id sub-12345`133- `az apim subscription regenerate-primary-key --service-name my-apim -g api-rg --subscription-id sub-12345`134- `curl -s -H "Ocp-Apim-Subscription-Key: $SUBSCRIPTION_KEY" https://my-apim.azure-api.net/petstore/pets`135136**Examples:**137- az apim subscription create --service-name my-apim -g api-rg --name svc-key --owner-id svc-account --scope /apis --primary-key $(openssl rand -hex 16)138- az apim subscription regenerate-secondary-key --service-name my-apim -g api-rg --subscription-id sub-12345139- curl -s -H "Ocp-Apim-Subscription-Key: $KEY" https://my-apim.azure-api.net/petstore/pets?limit=5140141## References142- [API Management Docs](https://learn.microsoft.com/en-us/azure/api-management/)143- [Azure CLI apim Reference](https://learn.microsoft.com/en-us/cli/azure/apim)