azure-mgmt-apicenter-pylisted
Install: claude install-skill aiskillstore/marketplace
# 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,