# Configure an Azure AI Gateway

AI teams need consistent controls for models, tools, and agents. This skill guides Azure API Management configuration for security, cost control, routing, and diagnostics.

## Install

```bash
npx skillstore add microsoft/azure-aigateway
```

## Metadata

- Status: approved
- Slug: microsoft-azure-aigateway
- Version: 0.0.0-placeholder
- Author version: 0.0.0-placeholder
- Skillstore revision: r2
- Version status: valid
- Tree hash: 83fec53d6b5f3d274c723fc0e0998191e7599046b81aa4d36c60fd401322d251
- Author: microsoft
- GitHub username: microsoft
- License: MIT
- Repository: https://github.com/microsoft/github-copilot-for-azure/tree/main/plugin/skills/azure-aigateway/
- Ref: ebdfe608f5de2b66ff37ab4af12af8ac4f5e8006
- 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: external\_commands, env\_access, network, filesystem
- Quality score: 38
- Quality tier: warning
- Public page: https://skillstore.pages.dev/skills/microsoft-azure-aigateway
- Manifest: https://skillstore.pages.dev/api/skills/microsoft-azure-aigateway/manifest

## Capabilities

- Configure APIM backends for Azure OpenAI and AI Foundry endpoints.
- Apply token limits, semantic caching, token metrics, and content safety policies.
- Set up managed identity authentication and Azure RBAC for backend access.
- Configure backend pools, retries, streaming support, and multi-tenant controls.
- Diagnose authentication, quota, cache, safety, backend, and health-check failures.

## Use Cases

- Govern Shared Model Access: Create centralized APIM controls for token budgets, caching, routing, and metrics across multiple AI applications.
- Protect Agent Tools: Add authentication, content safety, and authenticated rate limits to APIs exposed as MCP tools.
- Review Gateway Controls: Evaluate managed identity, RBAC, tenant isolation, content filtering, and operational diagnostics before production rollout.

## Prompt Templates

### Inspect an Existing Gateway

```
Inspect APIM instance <name> in resource group <group>. Summarize AI backends and missing prerequisites without changing resources.
```

### Add a Model Backend

```
Prepare commands and policies to add Azure OpenAI resource <resource> to APIM <name>. Use managed identity and least-privilege RBAC.
```

### Apply Governance Controls

```
Design an inbound APIM policy for <workload> with token limits, semantic caching, content safety, rate limiting, and token metrics. Explain policy order.
```

### Design a Resilient Multi-Tenant Gateway

```
Design a multi-region, multi-tenant AI gateway for <requirements>. Include authenticated tenant keys, backend failover, cost controls, observability, and a verification plan.
```

## Limitations

- Requires Azure CLI and existing Azure resources; it does not deploy APIM.
- Examples use placeholders and must be reviewed before execution.
- Some APIM AI policies and backend pools depend on service tier, region, or preview availability.
- Streaming does not support semantic caching or token metrics in the documented patterns.

## Best Practices

- Use managed identities and narrow Azure RBAC scopes for all production backends.
- Validate resource names, subscriptions, regions, and policy availability before running commands.
- Use authenticated identities for rate-limit keys and keep credentials out of prompts, logs, and command output.

## Anti Patterns

- Do not use DefaultAzureCredential in production Azure workloads.
- Do not import mutable remote specifications without pinning and reviewing their contents.
- Do not trust caller-supplied headers for tenant isolation or rate limiting.

## Security Audit

- Audited at: 2026-07-23T17:49:03.206\+00:00
- Summary: The audit reviewed 80 static findings; 79 are documentation-related false positives. One finding is confirmed because an example imports an OpenAPI specification from a mutable branch. Semantic review also found caller-controlled rate-limit keys and commands that expose subscription keys.

## Stats

- Views: 143
- Downloads: 11
- Favorites: 0
- Popularity score: 0
