30-minute essentials
EveryoneProvision a gateway, publish a model and an MCP server, and make your first governed calls.
Azure AI Gateway labs
Hands-on labs to govern every model, tool, and agent from one gateway. Publish models from any provider, federate MCP tools, enforce limits and budgets, go keyless, observe every token, and govern agents.
Select any part to preview the lab that teaches it.
Start here · 5 minutes
In the AI Gateway portal, with a few Azure CLI commands in Cloud Shell, or with one azd up, you create a gateway, publish a Microsoft Foundry model behind an alias, and create a runtime key. Then you make your first call through the gateway, the way an app does: with the alias and the key.
⏳ Gateway aigw-540780 is provisioning in the background✨ Model deployment gpt-5-mini is ready🚀 Gateway aigw-540780 is ready🔖 Alias gpt-5-mini is ready🔑 API key app-first-call is ready🌐 Runtime URL: https://aigw-54078-q2mv7x4kz9hpt.eastus2-01.ai.gateway.azure.com$ curl $AI_GATEWAY_URL/…/chat/completions -H "Authorization: Bearer …"🤖 An AI gateway sits between applications and AI models, routing requests while managing access, security, and usage.
How you learn
Every lab offers the tracks that fit the task. Pick one and the site remembers it across labs.
Click-by-click guides in the AI Gateway portal, with exact labels and screenshots.
Repeatable az aigateway and az deployment commands you can paste into Bash or PowerShell.
Infrastructure as code: deploy a lab with azd up or terraform apply, and remove it with one command.
Python, TypeScript, and .NET clients, agent frameworks, and REST calls.
Learning paths
Each path strings labs together in order. Your progress is saved in this browser.
Provision a gateway, publish a model and an MCP server, and make your first governed calls.
Stand up a production-ready gateway with multi-provider models, tool federation, baselines, and private networking.
Call models and MCP tools from SDKs, agent frameworks, Foundry Hosted Agents, and coding agents.
Move from keys to Entra ID, enforce content safety, restrict tools, and adopt Agent 365 protections.
Throttle tokens, enforce budgets, observe usage, and attribute cost to teams with OpenTelemetry.
Use cases
Start with the controls every AI platform needs, then explore agent-era governance.
Catalog
Publish a Microsoft Foundry model deployment through your gateway with its managed identity, create a runtime API key, try the model in the Catalog playground, and call it from curl, PowerShell, Python, TypeScript, and C#.
Register a remote MCP server in Azure AI Gateway, add a second backend under its own namespace, and connect curl, VS Code, and Python to one governed MCP endpoint.
Cap how many tokens each app, agent, or user can consume per minute, hour, or day, and watch the gateway answer with 429 and Retry-After before your backend capacity runs out.
Give every app, agent, and user a dollar budget per hour, day, or month, raise or lower it for specific API keys and Microsoft Entra identities, and watch the gateway answer 403 LlmCostQuotaExceeded once a caller's estimated spend runs out.
Replace shared gateway API keys with Microsoft Entra ID tokens. Grant users, groups, apps, and managed identities an AI Gateway runtime role on all assets, a model alias, or an MCP server, call models from the playground, curl, Python, TypeScript, and C# with no secret in code, and grant management access separately with the control-plane roles.
Deploy your own Microsoft Agent Framework agent to Foundry Hosted Agents with azd. The agent has no model deployment, no direct tool access, and no keys. It calls its model through AI Gateway with its own Microsoft Entra Agent ID, and reaches the Microsoft Learn MCP server through a Foundry toolbox that signs in with the project's managed identity. Run it locally, invoke it in Foundry, and cap its tokens without changing its code.
Inside every lab
Resources