azure-mgmt-apicenter-py

Azure API Center Management SDK for Python. Use for managing API inventory, metadata, and governance across your organization.

31,392 stars
Complexity: easy

About this skill

This skill empowers AI agents to programmatically interact with the Azure API Center service. By leveraging the `azure-mgmt-apicenter-py` SDK, agents can perform comprehensive management of an organization's API landscape, including inventorying APIs, defining and updating metadata, and enforcing governance policies. This capability allows AI agents to automate tasks such as discovering available APIs, registering new APIs, updating API specifications, or querying API-related information directly from Azure. It significantly enhances an agent's ability to assist in API lifecycle management, ensure compliance, and streamline operations for API teams.

Best use case

Automating API discovery and registration; enforcing API governance policies; maintaining an up-to-date API inventory; assisting developers or operations teams with API lifecycle management; generating reports on API usage and metadata.

Azure API Center Management SDK for Python. Use for managing API inventory, metadata, and governance across your organization.

Successful management of Azure API Center resources, such as creation, update, deletion, or retrieval of APIs, API versions, deployments, or environments, along with their associated metadata and governance settings, reported back to the user or integrated into a workflow.

Practical example

Example input

Can you list all APIs currently registered in our Azure API Center instance that are in the 'production' environment? Please include their names and current versions.

Example output

```json
{
  "status": "success",
  "action": "list_apis",
  "apis": [
    {"name": "PaymentGatewayService", "version": "v2", "environment": "production"},
    {"name": "UserProfileAPI", "version": "v1.5", "environment": "production"}
  ],
  "message": "Successfully retrieved 2 APIs from Azure API Center in 'production' environment."
}
```

When to use this skill

  • When an AI agent needs to programmatically interact with Azure API Center to manage APIs, update metadata, or perform governance tasks. Useful for automating cloud infrastructure or API-related workflows within an Azure environment.

When not to use this skill

  • For tasks unrelated to Azure API Center management. When the user does not have an Azure subscription or necessary permissions. When managing APIs on other cloud platforms or on-premises solutions not integrated with Azure API Center.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/azure-mgmt-apicenter-py/SKILL.md --create-dirs "https://raw.githubusercontent.com/sickn33/antigravity-awesome-skills/main/plugins/antigravity-awesome-skills-claude/skills/azure-mgmt-apicenter-py/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/azure-mgmt-apicenter-py/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How azure-mgmt-apicenter-py Compares

Feature / Agentazure-mgmt-apicenter-pyStandard Approach
Platform SupportClaudeLimited / Varies
Context Awareness High Baseline
Installation ComplexityeasyN/A

Frequently Asked Questions

What does this skill do?

Azure API Center Management SDK for Python. Use for managing API inventory, metadata, and governance across your organization.

Which AI agents support this skill?

This skill is designed for Claude.

How difficult is it to install?

The installation complexity is rated as easy. You can find the installation instructions above.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Azure API Center Management SDK for Python

Manage API inventory, metadata, and governance in Azure API Center.

## Installation

```bash
pip install azure-mgmt-apicenter
pip install azure-identity
```

## Environment Variables

```bash
AZURE_SUBSCRIPTION_ID=your-subscription-id
```

## Authentication

```python
from azure.identity import DefaultAzureCredential
from azure.mgmt.apicenter import ApiCenterMgmtClient
import os

client = ApiCenterMgmtClient(
    credential=DefaultAzureCredential(),
    subscription_id=os.environ["AZURE_SUBSCRIPTION_ID"]
)
```

## Create API Center

```python
from azure.mgmt.apicenter.models import Service

api_center = client.services.create_or_update(
    resource_group_name="my-resource-group",
    service_name="my-api-center",
    resource=Service(
        location="eastus",
        tags={"environment": "production"}
    )
)

print(f"Created API Center: {api_center.name}")
```

## List API Centers

```python
api_centers = client.services.list_by_subscription()

for api_center in api_centers:
    print(f"{api_center.name} - {api_center.location}")
```

## Register an API

```python
from azure.mgmt.apicenter.models import Api, ApiKind, LifecycleStage

api = client.apis.create_or_update(
    resource_group_name="my-resource-group",
    service_name="my-api-center",
    workspace_name="default",
    api_name="my-api",
    resource=Api(
        title="My API",
        description="A sample API for demonstration",
        kind=ApiKind.REST,
        lifecycle_stage=LifecycleStage.PRODUCTION,
        terms_of_service={"url": "https://example.com/terms"},
        contacts=[{"name": "API Team", "email": "api-team@example.com"}]
    )
)

print(f"Registered API: {api.title}")
```

## Create API Version

```python
from azure.mgmt.apicenter.models import ApiVersion, LifecycleStage

version = client.api_versions.create_or_update(
    resource_group_name="my-resource-group",
    service_name="my-api-center",
    workspace_name="default",
    api_name="my-api",
    version_name="v1",
    resource=ApiVersion(
        title="Version 1.0",
        lifecycle_stage=LifecycleStage.PRODUCTION
    )
)

print(f"Created version: {version.title}")
```

## Add API Definition

```python
from azure.mgmt.apicenter.models import ApiDefinition

definition = client.api_definitions.create_or_update(
    resource_group_name="my-resource-group",
    service_name="my-api-center",
    workspace_name="default",
    api_name="my-api",
    version_name="v1",
    definition_name="openapi",
    resource=ApiDefinition(
        title="OpenAPI Definition",
        description="OpenAPI 3.0 specification"
    )
)
```

## Import API Specification

```python
from azure.mgmt.apicenter.models import ApiSpecImportRequest, ApiSpecImportSourceFormat

# Import from inline content
client.api_definitions.import_specification(
    resource_group_name="my-resource-group",
    service_name="my-api-center",
    workspace_name="default",
    api_name="my-api",
    version_name="v1",
    definition_name="openapi",
    body=ApiSpecImportRequest(
        format=ApiSpecImportSourceFormat.INLINE,
        value='{"openapi": "3.0.0", "info": {"title": "My API", "version": "1.0"}, "paths": {}}'
    )
)
```

## List APIs

```python
apis = client.apis.list(
    resource_group_name="my-resource-group",
    service_name="my-api-center",
    workspace_name="default"
)

for api in apis:
    print(f"{api.name}: {api.title} ({api.kind})")
```

## Create Environment

```python
from azure.mgmt.apicenter.models import Environment, EnvironmentKind

environment = client.environments.create_or_update(
    resource_group_name="my-resource-group",
    service_name="my-api-center",
    workspace_name="default",
    environment_name="production",
    resource=Environment(
        title="Production",
        description="Production environment",
        kind=EnvironmentKind.PRODUCTION,
        server={"type": "Azure API Management", "management_portal_uri": ["https://portal.azure.com"]}
    )
)
```

## Create Deployment

```python
from azure.mgmt.apicenter.models import Deployment, DeploymentState

deployment = client.deployments.create_or_update(
    resource_group_name="my-resource-group",
    service_name="my-api-center",
    workspace_name="default",
    api_name="my-api",
    deployment_name="prod-deployment",
    resource=Deployment(
        title="Production Deployment",
        description="Deployed to production APIM",
        environment_id="/workspaces/default/environments/production",
        definition_id="/workspaces/default/apis/my-api/versions/v1/definitions/openapi",
        state=DeploymentState.ACTIVE,
        server={"runtime_uri": ["https://api.example.com"]}
    )
)
```

## Define Custom Metadata

```python
from azure.mgmt.apicenter.models import MetadataSchema

metadata = client.metadata_schemas.create_or_update(
    resource_group_name="my-resource-group",
    service_name="my-api-center",
    metadata_schema_name="data-classification",
    resource=MetadataSchema(
        schema='{"type": "string", "title": "Data Classification", "enum": ["public", "internal", "confidential"]}'
    )
)
```

## Client Types

| Client | Purpose |
|--------|---------|
| `ApiCenterMgmtClient` | Main client for all operations |

## Operations

| Operation Group | Purpose |
|----------------|---------|
| `services` | API Center service management |
| `workspaces` | Workspace management |
| `apis` | API registration and management |
| `api_versions` | API version management |
| `api_definitions` | API definition management |
| `deployments` | Deployment tracking |
| `environments` | Environment management |
| `metadata_schemas` | Custom metadata definitions |

## Best Practices

1. **Use workspaces** to organize APIs by team or domain
2. **Define metadata schemas** for consistent governance
3. **Track deployments** to understand where APIs are running
4. **Import specifications** to enable API analysis and linting
5. **Use lifecycle stages** to track API maturity
6. **Add contacts** for API ownership and support

## When to Use
This skill is applicable to execute the workflow or actions described in the overview.

Related Skills

azure-resource-manager-sql-dotnet

31392
from sickn33/antigravity-awesome-skills

Azure Resource Manager SDK for Azure SQL in .NET.

Cloud ManagementClaudeGitHub CopilotCursor

azure-resource-manager-redis-dotnet

31392
from sickn33/antigravity-awesome-skills

Azure Resource Manager SDK for Redis in .NET.

Cloud ManagementClaude

azure-resource-manager-postgresql-dotnet

31392
from sickn33/antigravity-awesome-skills

Azure PostgreSQL Flexible Server SDK for .NET. Database management for PostgreSQL Flexible Server deployments.

Cloud ManagementClaude

azure-resource-manager-mysql-dotnet

31392
from sickn33/antigravity-awesome-skills

Azure MySQL Flexible Server SDK for .NET. Database management for MySQL Flexible Server deployments.

Cloud ManagementClaude

azure-resource-manager-cosmosdb-dotnet

31392
from sickn33/antigravity-awesome-skills

Azure Resource Manager SDK for Cosmos DB in .NET.

Cloud ManagementClaude

azure-monitor-query-py

31392
from sickn33/antigravity-awesome-skills

Azure Monitor Query SDK for Python. Use for querying Log Analytics workspaces and Azure Monitor metrics.

Cloud ManagementClaude

azure-mgmt-weightsandbiases-dotnet

31392
from sickn33/antigravity-awesome-skills

Azure Weights & Biases SDK for .NET. ML experiment tracking and model management via Azure Marketplace. Use for creating W&B instances, managing SSO, marketplace integration, and ML observability.

Cloud ManagementClaude

azure-mgmt-botservice-py

31392
from sickn33/antigravity-awesome-skills

Azure Bot Service Management SDK for Python. Use for creating, managing, and configuring Azure Bot Service resources.

Cloud ManagementClaudeChatGPTGemini

azure-mgmt-botservice-dotnet

31392
from sickn33/antigravity-awesome-skills

Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings.

Cloud ManagementClaude

azure-containerregistry-py

31392
from sickn33/antigravity-awesome-skills

Azure Container Registry SDK for Python. Use for managing container images, artifacts, and repositories.

Cloud ManagementClaude

azure-keyvault-certificates-rust

31355
from sickn33/antigravity-awesome-skills

Azure Key Vault Certificates SDK for Rust. Use for creating, importing, and managing certificates.

Cloud ManagementClaude

cost-optimization

31392
from sickn33/antigravity-awesome-skills

Strategies and patterns for optimizing cloud costs across AWS, Azure, and GCP.

Cloud ManagementClaude