
Azure Aigateway
- 481k installs
- 1.3k repo stars
- Updated July 26, 2026
- microsoft/azure-skills
azure-aigateway is an agent skill that configures Azure API Management as a governed AI gateway for routing traffic to LLMs, MCP tools and agents.
About
azure-aigateway configures Azure API Management as an AI gateway that routes and governs traffic to LLMs, MCP servers and agent tools. A developer uses it to add Azure OpenAI or AI Foundry backends, apply policies for semantic caching, token limits, token metrics and content safety, and test the gateway endpoint. It documents an az CLI workflow plus a .NET SDK quick reference using Azure.ResourceManager.ApiManagement and Azure.Identity. It requires the Azure CLI for configuration and testing.
- Configures Azure API Management (APIM) as an AI gateway for LLMs, MCP tools and agents
- Applies policies for semantic caching, token limits, token metrics and content safety
- Adds Azure OpenAI / AI Foundry backends and load-balances across models
- Ships a .NET SDK quick reference (Azure.ResourceManager.ApiManagement + Azure.Identity)
Azure Aigateway by the numbers
- 480,801 all-time installs (skills.sh)
- Security screen: MEDIUM risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
azure-aigateway capabilities & compatibility
Free skill; requires Azure CLI and an APIM instance. Underlying Azure API Management and AI services are billed by Azure.
- Capabilities
- ai gateway config · llm governance · semantic caching · token rate limiting · content safety · mcp rate limiting
- Works with
- azure · openai
- Use cases
- orchestration · api development
- Pricing
- Free
What azure-aigateway says it does
Configure Azure API Management (APIM) as an AI Gateway for governing AI models, MCP tools, and agents.
Configure Azure API Management as an AI Gateway for AI models, MCP tools, and agents.
Requires Azure CLI (az) for configuration and testing
npx skills add https://github.com/microsoft/azure-skills --skill azure-aigatewayAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 481k |
|---|---|
| repo stars | ★ 1.3k |
| Security audit | 2 / 3 scanners passed |
| Last updated | July 26, 2026 |
| Repository | microsoft/azure-skills ↗ |
How do I put a governed gateway with caching, token limits and content safety in front of my Azure AI models and MCP tools?
orchestration
Who is it for?
Developers putting Azure API Management in front of Azure OpenAI, AI Foundry models or MCP tools to govern and rate-limit AI traffic.
Skip if: Deploying the APIM instance itself (use azure-prepare) or non-Azure gateways.
When should I use this skill?
The user asks about semantic caching, token limits, content safety, adding an Azure OpenAI backend, rate-limiting MCP, or testing an AI gateway on APIM.
What you get
An APIM AI gateway with AI backends, governance policies applied, and a tested chat-completions endpoint.
- APIM AI gateway with AI backends
- Applied governance policies (caching, token limits, content safety)
- Tested gateway chat-completions endpoint
By the numbers
- 6-step recommended inbound policy order
- 5 governance policies in the quick-reference table
Files
API Management — .NET SDK Quick Reference
Condensed from azure-mgmt-apimanagement-dotnet. Full patterns (service
creation, APIs, products, policies, users, gateways, backends)
in the azure-mgmt-apimanagement-dotnet plugin skill if installed.
Install
dotnet add package Azure.ResourceManager.ApiManagement dotnet add package Azure.Identity
Quick Start
Auth: DefaultAzureCredential is for local development. See auth-best-practices.md for production patterns.using Azure.ResourceManager;
using Azure.Identity;
var armClient = new ArmClient(new DefaultAzureCredential());Best Practices
- Use
WaitUntil.Completedfor operations that must finish before proceeding - Use
WaitUntil.Startedfor long operations like service creation (30+ min) - Use DefaultAzureCredential for local development only. In production, use ManagedIdentityCredential — see auth-best-practices.md
- Handle
RequestFailedExceptionfor ARM API errors - Use
CreateOrUpdateAsyncfor idempotent operations - Navigate hierarchy via
Get*methods (e.g.,service.GetApis()) - Policy format — use XML format for policies; JSON is also supported
- Service creation — Developer SKU is fastest for testing (~15-30 min)
--- name: azure-aigateway description: "Configure Azure API Management as an AI Gateway for AI models, MCP tools, and agents. WHEN: semantic caching, token limit, content safety, load balancing, AI model governance, MCP rate limiting, jailbreak detection, add Azure OpenAI backend, add AI Foundry model, test AI gateway, LLM policies, configure AI backend, token metrics, AI cost control, convert API to MCP, import OpenAPI to gateway." license: MIT metadata: author: Microsoft version: "3.1.1" compatibility: Requires Azure CLI (az) for configuration and testing ---
Azure AI Gateway
Configure Azure API Management (APIM) as an AI Gateway for governing AI models, MCP tools, and agents.
To deploy APIM, use the azure-prepare skill. See APIM deployment guide.
When to Use This Skill
| Category | Triggers |
|---|---|
| Model Governance | "semantic caching", "token limits", "load balance AI", "track token usage" |
| Tool Governance | "rate limit MCP", "protect my tools", "configure my tool", "convert API to MCP" |
| Agent Governance | "content safety", "jailbreak detection", "filter harmful content" |
| Configuration | "add Azure OpenAI backend", "configure my model", "add AI Foundry model" |
| Testing | "test AI gateway", "call OpenAI through gateway" |
---
Quick Reference
| Policy | Purpose | Details |
|---|---|---|
azure-openai-token-limit | Cost control | Model Policies |
azure-openai-semantic-cache-lookup/store | 60-80% cost savings | Model Policies |
azure-openai-emit-token-metric | Observability | Model Policies |
llm-content-safety | Safety & compliance | Agent Policies |
rate-limit-by-key | MCP/tool protection | Tool Policies |
---
Get Gateway Details
# Get gateway URL
az apim show --name <apim-name> --resource-group <rg> --query "gatewayUrl" -o tsv
# List backends (AI models)
az apim backend list --service-name <apim-name> --resource-group <rg> \
--query "[].{id:name, url:url}" -o table
# Get subscription key
az apim subscription keys list \
--service-name <apim-name> --resource-group <rg> --subscription-id <sub-id>---
Test AI Endpoint
GATEWAY_URL=$(az apim show --name <apim-name> --resource-group <rg> --query "gatewayUrl" -o tsv)
curl -X POST "${GATEWAY_URL}/openai/deployments/<deployment>/chat/completions?api-vRelated skills
How it compares
Use azure-aigateway when AI or MCP traffic needs APIM policy governance; use standard APIM skills for non-AI API publishing.
FAQ
What does azure-aigateway configure?
It configures Azure API Management (APIM) as an AI gateway to govern AI models, MCP tools and agents, adding backends and applying policies for caching, token limits, metrics and content safety.
How does it deploy the APIM instance?
It does not. To deploy APIM you use the azure-prepare skill; azure-aigateway configures an existing APIM as an AI gateway.
What SDK does it reference?
A .NET SDK quick reference using Azure.ResourceManager.ApiManagement and Azure.Identity, with policies expressed in XML (JSON also supported).
Is Azure Aigateway safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.