Azure API Management for Python
Gives coding agents practical Python SDK patterns for managing Azure API Management services, APIs, products, subscriptions, and policies.
The skill recommends DefaultAzureCredential, constraining production credential chains, avoiding connection strings and API keys, and using environment variables. However, service, subscription, user, policy, backend, and other external mutations lack user confirmation, least-privilege RBAC guidance, rollback, or deletion paths; one example prints a subscription primary key and examples include plaintext secrets and an HTTP backend, so points were deducted.
The examples cover authentication, synchronous clients, long-running operations, and several APIM operation groups with generally consistent instructions. They lack exception handling, pagination, retry guidance, idempotency validation, and diagnosable failure feedback; the references explicitly require rechecking current API names, so the score is conservative under the static cap.
The name, description, and trigger terms are clear, and the skill covers service, API, product, subscription, policy, secret, backend, and user scenarios. It does not clearly define non-fit boundaries, permission prerequisites, async implementations, or input validation, and it provides no mainland-China network or regional reachability guidance, so points were deducted.
The skill has YAML metadata, an MIT license, a version, installation and environment-variable notes, layered reference files, an operation-group table, and production checklists. It lacks a changelog, explicit maintenance owner/update path, dependency version constraints, FAQ, and complete cleanup examples, so points were deducted.
The skill provides broadly useful Python snippets for common APIM management tasks and many are directly adaptable. However, the examples assume an already-created client, resource group, and permissions, and omit end-to-end runnable setup, deletion/rollback, error handling, and validation steps; substantial integration and review remain necessary.
The pinned repository source, reference files, MIT license, and general CI/test infrastructure provide some auditability. There are no skill-specific acceptance criteria, committed tests, or third-party execution results, so the assessment is based mainly on static text and is scored conservatively under the static cap.
- All create and update operations, including policies, can cause real Azure resource or configuration changes; confirm the target subscription, resource group, permissions, and scope before execution and prepare a deletion or recovery plan.
- Do not print or hard-code subscription keys, API keys, or other secrets; use secure secret storage and least-privilege access.
- Verify SDK method names, model fields, and enums against the official documentation for the target package version; no skill-specific executable test evidence is provided.
- Importing an API from a URL and configuring a backend involve external data flows; review the URL, TLS, payload, and network reachability.
What it does & when to use it
This skill is for developers using the azure-mgmt-apimanagement Python SDK with Azure API Management. It covers service creation, OpenAPI import, API listing, product and subscription management, policy configuration, and selected backend, named value, and user operations. Its examples recommend DefaultAzureCredential and deterministic client cleanup through context managers, with an Azure subscription ID required. It fits Python projects automating API gateway administration, but it does not provide a complete application deployment workflow or examples for other languages.
Installs the azure-mgmt-apimanagement and azure-identity packages; reads AZURE_SUBSCRIPTION_ID and, when applicable, AZURE_TOKEN_CREDENTIALS; uses ApiManagementClient to call Azure APIs; creates or updates APIM services, imports OpenAPI definitions from inline JSON or a URL, lists APIs, creates products and subscriptions, associates APIs with products, applies XML API policies, and creates named values, backends, and users. The examples print resource names, display names, or a subscription primary key.
- A Python Azure developer needs to provision or update an APIM service and wants a ready SDK client pattern.
- An API team needs to import an OpenAPI document from JSON content or a URL into an existing APIM service.
- An API platform team needs to package APIs into products and create scoped subscriptions for consumers.
- A developer needs to apply rate limits and custom headers through an APIM API policy.
- A production team wants to access APIM with DefaultAzureCredential or managed identity while cleaning up clients and credentials deterministically.
Pros & cons
- Covers concrete APIM operations across services, APIs, products, subscriptions, policies, backends, named values, and users.
- Includes both inline OpenAPI JSON and OpenAPI URL import examples.
- Provides explicit guidance on DefaultAzureCredential, production credential-chain constraints, and client context managers.
- Explains consistent sync-versus-async usage and resource cleanup.
- It is specific to the Python SDK and does not cover other language clients.
- Examples require an Azure subscription and suitable permissions; the source does not provide an RBAC role or permission matrix.
- The source does not show dedicated test coverage for this individual skill.
- Application Insights and API versioning are recommended, but no implementation examples are provided for them.
How to install
For the collection, run npx skills add microsoft/skills in the supported agent workflow and select this skill. Alternatively, clone the repository and copy .github/plugins/azure-sdk-python/skills/azure-mgmt-apimanagement-py into the agent's skill directory. The README does not document a standalone installer for this individual skill.
How to use
Ask an installed coding agent with a trigger such as: Use azure-mgmt-apimanagement and ApiManagementClient to import an OpenAPI URL into an existing APIM service and apply a rate-limit policy. Before running generated Python code, install azure-mgmt-apimanagement and azure-identity, set AZURE_SUBSCRIPTION_ID, and configure AZURE_TOKEN_CREDENTIALS when using DefaultAzureCredential as specified by the skill.