# Automate Azure API Management with Python

Azure API Management configuration requires many SDK models and operation groups. This skill provides focused Python examples for common APIM administration workflows.

## Install

```bash
npx skillstore add sickn33/azure-mgmt-apimanagement-py
```

## Metadata

- Status: approved
- Slug: sickn33-azure-mgmt-apimanagement-py
- Skillstore revision: r2
- Version status: missing
- Tree hash: aebde3a3566a1e92ab74ae9b4f25c33accc607926a662ba2828dd9374af6ac94
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-mgmt-apimanagement-py
- Ref: f9e2c34b4f19c7f3e6b0a1e93227b5f77cc12526
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: confirmation\_required
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: scripts, external\_commands, network, env\_access
- Quality score: 38
- Quality tier: warning
- Public page: https://skillstore.pages.dev/skills/sickn33-azure-mgmt-apimanagement-py
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-azure-mgmt-apimanagement-py/manifest

## Capabilities

- Configures ApiManagementClient with DefaultAzureCredential and a subscription identifier.
- Creates an APIM service with a selected region, publisher, SKU, and capacity.
- Imports OpenAPI definitions from inline content or a remote document.
- Lists APIs and manages products, product associations, and subscriptions.
- Applies API-level XML policies, including rate limits and custom headers.
- Creates backends, users, and protected named values through SDK operation groups.

## Use Cases

- Build a First APIM Script: Authenticate with Azure, connect to an APIM service, and list existing APIs before making changes.
- Automate API Product Setup: Create products, associate APIs, configure subscriptions, and establish repeatable access packaging.
- Standardize API Controls: Import API definitions, configure backends, and apply consistent rate limits and headers.

## Prompt Templates

### Authenticate and List APIs

```
Using this skill, show Python authentication with DefaultAzureCredential and list APIs in {resource_group} and {service_name}. Explain each required input.
```

### Create an API Product

```
Create Python SDK steps for an APIM product named {product_id}, attach {api_id}, and create an active subscription. Keep identifiers configurable.
```

### Import and Protect an API

```
Import {openapi_url} into {service_name}, configure HTTPS, create {backend_url}, and apply a rate limit of {calls} requests per {period} seconds.
```

### Design a Production Workflow

```
Design a production APIM workflow that provisions a service, imports an API, creates a product, applies policies, and validates every result. Include idempotency, retries, and rollback guidance.
```

## Limitations

- Provides examples, not an executable automation package or complete deployment workflow.
- Requires Azure credentials, a subscription, installed SDK packages, and suitable resource permissions.
- Uses placeholders and omits production error handling, retries, idempotency, rollback, and validation.
- Includes credential examples that require safer secret handling before production use.

## Best Practices

- Use managed identity or DefaultAzureCredential and grant only the Azure roles required for each operation.
- Store secrets in Azure Key Vault or protected named values, and never print subscription keys.
- Test changes in a nonproduction APIM instance and validate long-running operation results before promotion.

## Anti Patterns

- Do not hardcode credentials, subscription keys, certificates, or backend secrets in generated scripts.
- Do not run create-or-update examples against production without reviewing names, regions, SKU costs, and policy scope.
- Do not assume examples provide retries, rollback, idempotency, or comprehensive input validation.

## Security Audit

- Audited at: 2026-07-23T21:05:42.754\+00:00
- Summary: All 45 static findings are false positives caused by Markdown formatting, fixed Python imports, documented URLs, and expected Azure configuration access. However, the examples print a subscription key and embed a secret value, which can expose credentials when copied into real workflows.

## Stats

- Views: 120
- Downloads: 7
- Favorites: 0
- Popularity score: 0
