From first project to a governed fleet of AI agents
One platform to build agents, choose models, ground them in your knowledge, run them at scale, and prove they are safe, observable and under control. This guide walks the whole path with live visuals and links to the official docs.
Consumers call agents. Agents use models, tools, knowledge and memory inside a project. A control plane watches and governs everything.
One platform, one management plane
Foundry unifies agents, models and tools under a single management grouping with enterprise capabilities built in: tracing, monitoring, evaluations and customizable enterprise setup. Role-based access, networking and policy are managed in one place under one Azure resource provider namespace.
Choose how much you want to own
Most work on Foundry centers on an agent: a model paired with instructions and tools that can reason over a request and take action. The main decision is how much of the runtime you want to control. You can start declarative and move to code later.
Product and capability map
| Capability | What it is | Reach for it when |
|---|---|---|
| Foundry portal | Web experience for models, agents, evaluations and resources. | You want to explore and prototype without code. |
| Prompt agents | Declarative agents: instructions, a model and tools. | You want an agent with no runtime to manage. |
| Hosted agents | Your own agent code or framework, run by Foundry. | You need full control of logic and dependencies. |
| Foundry Models | Catalog of models from Microsoft, OpenAI, Anthropic, Meta and others. | You are choosing and deploying the model behind an app or agent. |
| Fine-tuning | Customize a model on your data. | Prompting and retrieval cannot reach the quality you need. |
| Toolbox | One managed endpoint that packages the tools an agent can call. | You want to give agents actions and govern tools centrally. |
| Foundry IQ | Agentic retrieval over a knowledge base. | You want answers grounded in your content. |
| Memory Preview | Persistent agent recall across sessions. | An agent must remember prior turns or user context. |
| Evaluations / AI red teaming | Scoring and automated adversarial scans. | You need to measure quality and probe for unsafe behavior. |
| Guardrails and controls | Content filters and safety controls for models and agents. | You want to enforce safety at run time. |
| Foundry control plane Preview | Governance for agents, models and tools across your estate. | You manage many projects and need policy and oversight. |
Microsoft.CognitiveServices/accounts. Hub-based projects live in the Foundry (classic) portal; new investment is focused on Foundry projects in the new portal (use the New Foundry toggle).Every tab in the Foundry portal
The current portal splits features across six top-level sections, each with its own left pane. Click through the replica below to see what lives where, what it is scoped to, and which doc explains it.
Classic portal to current portal
| You used to… | Classic portal | Now |
|---|---|---|
| View model deployments | Models + endpoints | Build › Models |
| Browse the catalog | Model catalog | Discover › Model catalog |
| Build agents | Agents | Build › Agents |
| Run evaluations | Evaluation | Build › Evaluations |
| Trace and monitor | Tracing | Operate › Tracing |
| Manage quota | Management center › Quota | Manage › Quota |
| Manage users | Management center › Users | Manage › Project details › Users |
| Guardrails and content filters | Guardrails + controls | Operate › Compliance (and Build › Guardrails) |
create_version). The Assistants API sunsets August 26, 2026 and the azure-ai-inference package retires the same day, so migrate to the openai package and azure-ai-projects 2.x.Create a Foundry project
A project organizes agents, evaluations and files. It lives on a Foundry resource, which the portal creates for you. One resource can hold many projects that share its networking, policy and gateway.
Many projects, one resource: shared models, networking and governance, separate agents and project-level access.
- Sign in to Microsoft FoundryMake sure the New Foundry toggle is on. You need an Azure subscription and a role that can create a Foundry resource, such as Foundry Account Owner or Foundry Owner on the subscription or resource group.
- Select the project name (upper left), then Create new projectGive it a name and select Create project.
- Optional: advanced optionsPick an existing resource group or create a new one (recommended when starting, so you can manage and delete everything together), and choose the Location where project resources are hosted.
- Wait for provisioning, then copy the project endpointThe welcome screen shows it in the form
https://<resource>.services.ai.azure.com/api/projects/<project>. Deploy a model next (Discover › Model catalog › Deploy).
Create the resource, then a default project. Requires azure-identity and azure-mgmt-cognitiveservices>=13.7.0 and an az login session.
from azure.identity import DefaultAzureCredential
from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient
client = CognitiveServicesManagementClient(
credential=DefaultAzureCredential(),
subscription_id="<subscription-id>",
api_version="2025-04-01-preview",
)
# 1) Foundry resource
client.accounts.begin_create(
resource_group_name="<rg>", account_name="<foundry-resource>",
account={
"location": "eastus", "kind": "AIServices", "sku": {"name": "S0"},
"identity": {"type": "SystemAssigned"},
"properties": {"allowProjectManagement": True,
"customSubDomainName": "<foundry-resource>"},
},
).result()
# 2) Project on that resource
client.projects.begin_create(
resource_group_name="<rg>", account_name="<foundry-resource>",
project_name="<project>",
project={"location": "eastus", "identity": {"type": "SystemAssigned"}, "properties": {}},
).result()The docs include an Azure CLI path (Azure CLI 2.80 or later, Contributor or Owner on the resource group) and template options for repeatable, policy-compliant setups:
Foundry roles separate control plane from data plane. Assign the least privilege that fits the job.
| Role | Use it for |
|---|---|
| Foundry User | Least-privilege role for developers building and testing agents; data actions on the project. |
| Foundry Project Manager | Manage projects, build, and conditionally assign Foundry User to others. |
| Foundry Account Owner | Full access to manage projects and resources; can conditionally assign Foundry User, ACR and monitoring roles. |
| Foundry Owner | Account Owner plus building with projects; highly privileged, self-serve. |
For a team, you need a role that can assign roles (such as Owner) plus the email addresses or Entra security group IDs of the members.
Basic agent setup uses Microsoft-managed resources. Standard agent setup stores agent state in your own single-tenant Azure resources, for full data sovereignty and project-level isolation:
| Bring your own | What it stores |
|---|---|
| Azure Storage | Files uploaded by developers and end users |
| Azure AI Search | Vector stores created by agents |
| Azure Cosmos DB for NoSQL | Messages, conversation history and agent metadata (at least 3000 RU/s) |
| Azure Key Vault | Secrets management |
Pair it with network isolation (private link or managed virtual network) when you need to keep traffic off the public internet.
The model catalog and how you deploy it
Foundry gives you more than 10,000 models in two families. How you deploy a model decides where data is processed, how you pay, and how predictable latency is.
Sold by Azure
Hosted and operated by Azure, billed through your Azure subscription, covered by Azure SLAs and supported by Microsoft. Includes all Azure OpenAI models plus selected models from other top providers (for example DeepSeek, Meta, Mistral AI, Cohere and xAI collections).
From partners and community
Sold and operated by the provider (for example Anthropic's Claude). They require an Azure Marketplace subscription, and the provider sets license terms and price. You need Marketplace permissions to subscribe before you deploy.
Deployment types at a glance
Three categories: standard (pay per token), provisioned (reserved capacity) and batch (discounted, asynchronous). Within standard and provisioned you pick global, data zone or geography processing.
| Type | SKU code | Data processing | Billing | Best for |
|---|---|---|---|---|
| Global Standard | GlobalStandard | Any Azure region | Pay per token | General workloads, highest quota |
| Data Zone Standard | DataZoneStandard | Within the data zone (US, EU, APAC) | Pay per token | Zone compliance |
| Standard | Standard | Within an Azure geography | Pay per token | Geography compliance, low volume |
| Global / Data Zone / Regional Provisioned | GlobalProvisionedManaged · DataZoneProvisionedManaged · ProvisionedManaged | Global / zone / geography | Reserved PTU | Predictable high throughput |
| Global / Data Zone Batch | GlobalBatch · DataZoneBatch | Global / zone | 50% discount, 24 h | Large async jobs |
| Developer | DeveloperTier | Any region | Pay per token | Fine-tuned model evaluation only (24 h, no SLA) |
Which deployment type should I pick?
Model router: one deployment, many models
Model router is a trained model that routes each prompt to a suitable underlying model in real time, balancing quality, cost and latency, packaged as a single deployment. You deploy it like any other model.
Supports Global Standard and Data Zone Standard. Choose a model subset to control the pool. The effective context window is limited by the smallest underlying model. Claude models must be deployed first before router can use them.
More ways to get to a model
openai package against the project endpoint; API keys are optional.Frontier model access inside Foundry
Frontier models arrive in Foundry from several providers and with different access paths: some are available to everyone on Global Standard, some need a Marketplace subscription, some need a registration request, and some are gated research previews.
Azure OpenAI in Foundry models are sold by Azure. Model highlights listed in the docs include these series (newest first):
gpt-6.1-sol, gpt-6-astra, gpt-6-luna, gpt-6-solgpt-5.6-sol, -terra, -luna; gpt-5.5mini, nano, pro), 5.3 and 5.2 codex, 5.1, and the original GPT-5 seriesgpt-chat-latest with dated preview versionsgpt-oss, GPT-4.1, o-series reasoning, GPT-4o, embeddings, image, video (sora-2) and audiocomputer-use-preview) require a registration application and eligibility review before you can deploy.Claude is offered in two hosting versions. Both are sold and operated by Anthropic, purchased through Azure Marketplace, billed in CCU (see the cost sections), and supported through Microsoft Support.
| Hosted on Azure | Hosted on Anthropic infrastructure | |
|---|---|---|
| Where it runs | Azure infrastructure end to end (all GA) | Anthropic infrastructure, outside Azure |
| Deployment types | Global Standard and Data Zone Standard (US) | Global Standard only |
| Data residency | At rest in your Azure geography; processing scoped to global or data zone | May be processed outside the selected Azure region |
| APIs | Messages, token counting | Adds /files and /skills and more capabilities |
| Models | Opus 5.5 (and Fast), Opus 5, Opus 4.8, Sonnet 5 and 5.5, Haiku 5.5 and 4.5 | Those plus Fable (preview) and Mythos (gated research preview) and older versions |
- Current Claude models list a 1M token context window and up to 128K output, with adaptive thinking and an effort parameter.
- Gated research preview models (Mythos) use Microsoft Entra ID authentication only.
- Foundry does not apply built-in content filtering to Claude at deployment time. Configure Azure AI Content Safety during inference.
Other collections you can reach from the catalog (per the models-sold-by-Azure and partner pages):
grok-4 and grok-code-fast-1.Microsoft's own model families in Foundry include MAI models (MAI-Image, MAI-Thinking-1, MAI-Voice, MAI-Transcribe), Phi models and healthcare AI models. See each model's page for deployment options and regions.
The access ladder
Not every model needs every step. Work down this list and stop when the model is deployable:
Subscribing to partner models
You need Azure Marketplace permissions such as Microsoft.MarketplaceOrdering/agreements/offers/plans/sign/action and Microsoft.SaaS/resources/write to subscribe. Many organizations give this to a small group, so plan for it early.
Quota is per subscription and model
Claude quota is managed at the subscription level: all Global Standard deployments of one model share a single pool across regions. Request more through the quota form (also on the Foundry quota page); approvals can take several days.
Create a prompt agent
A prompt agent is defined entirely by a model, instructions and tools. Foundry hosts and runs it, so there is no code or container to maintain. Every change creates a new immutable version served through a stable endpoint.
Agent = reusable behavior. Conversation = server-side history. Response = one execution. Start with a response, then add an agent and a conversation as you need them.
- Deploy a modelAn agent needs a deployed model. Any Foundry direct model works;
gpt-5-miniis used in the quickstart. - Build › Agents › CreateName the agent and choose the model deployment.
- Write instructionsDefine role, tone, what the agent must and must not do, and how to use its tools. Keep them specific and testable.
- Add tools and knowledgeAttach a toolbox, MCP servers, file search, Foundry IQ, memory, web search, code interpreter and more (see the tools section).
- Test in the playgroundChat, inspect tool calls, adjust, and save. Each save is a new version.
- Evaluate, then shareRun an evaluation, add a guardrail, then Publish to Teams and Microsoft Copilot or call the endpoint from your app.
Install azure-ai-projects>=2.3.0 (the 2.x SDK targets the current portal; it is not compatible with 1.x) and sign in with az login.
from azure.identity import DefaultAzureCredential
from azure.ai.projects import AIProjectClient
from azure.ai.projects.models import PromptAgentDefinition
project = AIProjectClient(
endpoint="https://<resource>.services.ai.azure.com/api/projects/<project>",
credential=DefaultAzureCredential(),
)
# Create (or update) the agent: every call produces a new immutable version
agent = project.agents.create_version(
agent_name="my-agent",
definition=PromptAgentDefinition(
model="gpt-5-mini",
instructions="You are a helpful assistant that answers general questions",
),
)
# Chat with it over the Responses API, with server-side conversation state
openai = project.get_openai_client(agent_name="my-agent")
conversation = openai.conversations.create()
reply = openai.responses.create(conversation=conversation.id, input="Hello!")
print(reply.output_text)The same flow exists for C#, TypeScript, Java and REST.
Voice-based prompt agents
Real-time spoken experiences. Configure the model, instructions, audio settings, an optional greeting and tools; connect through Voice Live. Foundry manages lifecycle and voice orchestration. Telephony channels, image input in a turn, sub-agents and voice-specific optimization are documented.
Workflows Preview
Orchestrate several agents and steps when one task spans more than one agent. If a single agent with tools can finish the job, keep it simple. Declarative workflows can also be used and migrated in VS Code.
Agent-to-agent (A2A)
Agents can delegate to other agents. A2A v1.0 is generally available; v0.3 is preview. You can enable incoming A2A on a Foundry agent so other agents can call it.
Routines Preview
Trigger agent work from schedules and events rather than only from user messages.
Every agent gets a stable endpoint. It is live from creation, and you do not need to publish for programmatic access.
| Protocol | Path under /agents/{agent}/endpoint/protocols/ |
|---|---|
| Responses (default) | openai/responses |
| Activity (Teams, Microsoft 365) | activityprotocol |
| Invocations | invocations |
| A2A v1.0 GA · v0.3 preview | a2a |
| MCP Preview | mcp |
- Version routing. By default 100% of traffic goes to the latest version. Pin a version with a
version_selectorwhen an agent is in production or published. - Inbound auth. Azure RBAC (Entra) by default, plus agent-blueprint and Bot Service schemes used when publishing. API key authentication is not supported for agent endpoints.
- Classic migration. Assistants-style agents move to the new agent model and the Responses API.
- Keep instructions short, concrete and verifiable. Put long reference content in a knowledge source, not in the prompt.
- Describe when to use each tool and what its parameters mean; vague tool descriptions are a common cause of wrong tool calls.
- Prefer one agent with the right tools over a multi-agent workflow until you need orchestration.
- Build an evaluation dataset early so every change is measured, not anecdotal.
- Let the agent optimizer propose better instructions and tool descriptions against your dataset (next sections).
Build a RAG pattern agent
A model alone has a knowledge cutoff and cannot see your content. Retrieval-augmented generation (RAG) lets an agent look things up first, then answer from what it found, with citations. Foundry offers three retrieval paths that scale from a handful of files to an enterprise knowledge layer.
Pick the lightest path that fits. You can combine them on one agent.
| Path | Best when | What you manage |
|---|---|---|
| File search | A few user or developer files; fastest way to a working RAG agent. | Upload files; the service builds a vector store. In standard setup, vector stores live in your own Azure AI Search. |
| Azure AI Search tool | You already have a search index, or need custom indexing and ranking. | Your index and its connection to the project. |
| Foundry IQ knowledge base | Several sources, permission-aware answers, shared by many agents. | A knowledge base with knowledge sources; Azure AI Search powers it behind the scenes. |
| Web search / Bing grounding | Fresh public information. | Tool configuration; review data-sharing for web tools. |
Build one, step by step
- Choose the retrieval pathUse the table above. Start with file search to prove value, move to Foundry IQ when content is spread across sources or needs permissions.
- Create the knowledgeUpload files (Build › Data), or create a knowledge base (Build › Knowledge) with a search service and one or more knowledge sources.
- Create the agent and attach the knowledgeIn Build › Agents, add the file search tool, the Azure AI Search tool, or connect the knowledge base.
- Instruct for groundingTell the agent to answer only from retrieved content, to cite sources, and to say when it does not know.
- Test with hard questionsInclude questions with no answer in your content, and questions a user should not be allowed to see.
- Evaluate retrieval and groundednessUse the RAG evaluators: Retrieval, Document Retrieval, Groundedness, Relevance and Response Completeness. Gate releases on the scores.
Foundry IQ: a permission-aware knowledge base for agents
Foundry IQ lets you create a configurable, multi-source knowledge base that gives agents grounded, permission-aware answers from your organization's data. Multiple agents can share the same knowledge base.
Agentic retrieval decomposes a complex question into subqueries, runs them in parallel across sources, reranks semantically, and returns unified results that respect the caller's permissions.
Set it up
- Open Build › KnowledgeMake sure New Foundry is on and select your project.
- Create or connect a search serviceIt must support agentic retrieval. For a proof of concept use the free tier of Azure AI Search and the free allocation of tokens for agentic retrieval.
- Create a knowledge baseAdd one knowledge source at a time, then configure retrieval behavior.
- Build › Agents: connect the knowledge baseCreate or select an agent and connect it. Refine in the playground.
Create knowledge sources, create a knowledge base that references them, connect an agent, then send messages and refine. You can use a knowledge base from Foundry Agent Service, Microsoft Agent Framework or any custom app through the knowledge base REST API or Azure AI Search SDK clients. A private agentic retrieval tutorial covers inbound and outbound private connectivity.
After you connect a knowledge base to an Agent Service agent you can also add that agent to Microsoft Copilot Studio Preview.
Each is standalone, and you can use them together for broader organizational context.
Memory: agents that remember
Memory is a managed, long-term store that lets an agent keep user preferences, facts and context across sessions, devices and workflows. Short-term memory covers the current conversation; Foundry memory is built for the long term.
Extraction, consolidation and retrieval run behind the scenes. An LLM merges overlapping facts and resolves conflicts, such as a newly mentioned allergy, so the store stays accurate.
Three kinds of long-term memory
| Type | What it holds | Retrieve… |
|---|---|---|
| User profile | Durable preferences and personal context: language, defaults, accessibility needs. | Near the start of each conversation, for stable personalization. |
| Chat summary | Distilled summaries of earlier topics and threads. | Per turn, using the current messages, for continuity. |
| Procedural | Reusable how-to routines and patterns inferred from prior interactions. | When the user asks for a recurring workflow the agent has handled before. |
Memory search tool
Attach it to a prompt agent so the agent reads from and writes to the store during conversations. This is the simplest and recommended path. Scope can be resolved automatically from the caller with {{$userId}}.
Memory store APIs
Low-level control over individual memory records, retention and explicit lifecycle operations. You must set the scope explicitly in every request.
Hosted agents can add persistent memory too (see the hosted agent quickstart), and LangChain and LangGraph can use Foundry Memory.
- Item-level CRUD: create, read, update, list and delete individual memories.
- Store-level default retention: a default TTL in seconds for new entries, set at store creation.
- Direct commands: immediate remember-or-forget when users ask.
- Each type (user profile, chat summary, procedural) can be enabled or disabled when you create a store.
- Requires compatible Azure OpenAI chat and embedding model deployments.
- Virtual network integration is not supported for memory stores.
- Billed for the underlying chat and embedding models you configure; pricing can change during preview.
- Available in a defined list of regions; check the docs before choosing yours.
Because an LLM extracts and consolidates memories from conversations, incorrect or harmful content can be stored and later steer the agent (prompt injection, memory corruption). Mitigate by:
- Using Azure AI Content Safety and prompt-injection detection on content entering and leaving the memory system.
- Regularly stress-testing the agent with controlled adversarial exercises (AI red teaming).
- Keeping per-user scopes so one user's memories never reach another.
Agent optimizer: better instructions, measured
Prompt engineering is a slow, subjective loop: write, test, find weaknesses, rewrite. The agent optimizer automates it with an evaluation-driven cycle that improves instructions, tool descriptions, skills and model choice against your own dataset.
You then promote the winning candidate to a new prompt-agent version, or apply it to your hosted agent's configuration and redeploy.
| Target | What changes | Prompt agent | Hosted agent |
|---|---|---|---|
| Instruction tuning | Rewrites and refines the system prompt. | Yes | When an instructions.md exists |
| Skill improvement | Refines reusable skill bodies, keeping their purpose. | No | When a skills/ folder exists |
| Tool optimization | Improves function-calling tool and parameter descriptions (not types or required fields). | Yes | When a tools.json exists |
| Model selection | Tests the agent across candidate deployments for the best quality-to-cost trade-off. | Pick models in the wizard | model_search_space in eval.yaml |
- Open the agent's Optimize tabBuild › Agents › your agent › Optimize. No code changes are required for prompt agents.
- Select the baseline versionThe prompt-agent version you will compare candidates against.
- Choose a datasetGenerate one from agent traces, pick an existing Foundry dataset, or upload one.
- Choose evaluation criteriaBuilt-in or custom evaluators for the behaviors you want to improve.
- Choose models and review the cost estimatePick the evaluation model and candidate models. The Review step shows a modeled Minimum, Estimated and Maximum cost before you submit.
- Review results and promoteCompare scores, the before-and-after prompt and per-evaluator results, then promote the best candidate to a new version.
Hosted agents must be optimizer-ready: the agent loads its configuration (instructions and optionally skills and tool definitions) through the optimization package, so it can load a candidate during a run with no feature flags. Foundry Toolkit for VS Code scaffolds this automatically; with the Azure Developer CLI you add it yourself. Datasets can be local JSONL files or datasets registered in your project, including those generated from traces. After a run, apply the winning candidate locally, review, and redeploy.
azd ai agent optimize apply --candidate <candidate-id> azd deploy
- Two models are used: an eval model that scores responses (any chat-completion model) and an optimization model that generates candidates (a more capable one usually produces better candidates).
- The portal estimate is modeled from static token assumptions. It is neither a spending limit nor a substitute for your invoice. Measured token usage appears after the run.
- The pre-run estimate is currently available for prompt agents in the portal; hosted-agent flows show post-run token usage.
Toolbox, tool catalog and connectors
Agents become useful when they can act. Instead of wiring every tool, credential and policy into every agent, a Toolbox lets you define a curated set of tools once and expose them through a single MCP-compatible endpoint any agent can consume.
Toolboxes are created in Foundry but are not Foundry-bound: any MCP-compatible runtime or client can use one.
tool_search, call_tool) so hundreds of tools do not flood the context.Every kind of tool
| Tool | What it does |
|---|---|
| MCP | Connect to a remote Model Context Protocol server. |
| Web search · Grounding with Bing | Fresh public information with citations. |
| File search · Azure AI Search | RAG over uploaded files or your search index. |
| Foundry IQ · Fabric IQ · Work IQ | Knowledge, analytics semantics and Microsoft 365 context. |
| Code interpreter | Run code in a sandbox for calculations, files and charts. |
| OpenAPI | Call a REST API described by an OpenAPI spec. |
| Azure Functions | Invoke your serverless functions. |
| Function calling | Your app executes the function on the client side. |
| SharePoint · Fabric data agent Preview | Ground in SharePoint or query through a Fabric data agent. |
| Browser automation · Computer use | Drive a browser or UI (computer use is preview). |
| A2A | Delegate to another agent. |
| Image generation · Reminder Preview | Generate images; schedule reminders. |
| Foundry Tools | Azure Speech, Language, and other Foundry Tools services. |
The tool catalog includes 1,000+ connectors to SaaS, data and line-of-business systems Preview. Adding one makes Foundry create a managed MCP server in your account's Connector Namespace, so you write no server code.
- BrowseFind the connector in the Tools catalog (Build › Tools).
- ConnectAuthenticate to the service (API key, OAuth account or personal access token).
- Select actionsChoose which actions to expose as MCP tools.
- Add toolFoundry creates the managed MCP server and adds it to your agent or toolbox.
| Publisher tier | Examples | Data responsibility |
|---|---|---|
| Microsoft (internal services) | SharePoint, Teams, Dynamics 365 | Stays on Microsoft infrastructure |
| Microsoft (external services) | GitHub | Microsoft policies in transit; external company's at the destination |
| Verified third party | Docusign, Databricks, Box | Review the publisher's privacy terms |
| Independent publisher | Community connectors | Lower certification bar; review carefully |
Only actions are supported (no triggers). Managed MCP servers are scoped to the project where they are created and available in a defined list of regions. You need the Foundry Project Manager role on the project.
- Custom MCP: Build › Tools › Custom › Model Context Protocol, then paste your endpoint and pick an auth type. Build your own MCP server if none exists.
- Private tool catalog: publish approved tools for your organization to discover and reuse. A private skill catalog is also available in preview.
- Skills Preview: versioned, immutable, multi-step workflows packaged as capabilities. Tools define what an agent can do; skills define how.
The toolbox handles credential injection, token refresh and policy enforcement at run time, so consuming agents do not manage per-tool secrets.
- Microsoft Entra ID and OAuth identity passthrough (user delegation) for tools that act on behalf of a user.
- Agent identity for autonomous or background work.
- Key-based where a tool requires it, stored through a Key Vault connection rather than in code.
Treat tools as a supply chain. Third-party MCP servers are Non-Microsoft Products; vet them, review data sharing, and require approvals for risky actions.
- Route new MCP tools through an AI gateway Preview to enforce authentication, rate limits, IP restrictions and audit logging without changing the MCP server or agent code.
- Apply guardrails to tool calls and tool responses at the toolbox.
- Version toolboxes and promote a new default only after testing.
Publish agents to Microsoft Copilot and Teams
You publish the agent's stable endpoint, so end users always talk to one consistent agent while you roll out new versions behind it. Foundry builds the Teams app package and submits it for you.
- Test thoroughly in the portalConfirm responses and every tool work as expected.
- Select the active versionDetails tab › Agent configuration › Active version › Edit, or from the Publish button. Choose Always use latest or pin a specific version (recommended for production).
- Select Publish › Teams and Microsoft CopilotAn Azure Bot Service resource is created automatically, or shown read-only if one exists.
- Complete the metadataName, a three-part publish version (major.minor.patch), short description, description and developer. Optionally add website, terms of use and privacy statement URLs (HTTPS).
- Choose the scopeJust you, or people in your organization.
- Get admin approval if you chose organization scopeAfter approval the agent appears for everyone in your tenant under Built by your org.
- Foundry User role on the project to create, manage and publish agents.
- Azure Bot Service Contributor (or Contributor or Owner) on the resource group, to create the bot and configure its channels. Foundry roles do not grant these permissions.
- Register the provider:
az provider register --namespace Microsoft.BotService. - An agent version you tested and want to publish.
| Scope | Authorization scheme | Approval | Visibility |
|---|---|---|---|
Just you (portal) · Shared (REST) | BotServiceRbac | None | Only you; in a Teams chat, participants with the required Foundry permissions on the project can use it. |
People in your organization · Tenant | BotServiceTenant | Admin, in the Microsoft 365 admin center | Everyone in the tenant can discover and use it. |
- Projects that disable public network access cannot publish from the portal. Use the REST API and enable the source-IP-filtered public Activity Protocol route with
enable_m365_public_endpoint; requests must come from Azure Bot Service or Microsoft 365 source ranges and still satisfy authorization. - Hosted agents built on the Responses protocol are bridged to the Activity protocol automatically for channel delivery. Interactive calls can use OAuth on-behalf-of flows; background calls use the agent's own Entra identity.
- You can also publish an agent as an autopilot in Agent 365.
Hosted agents: architecture, compute and runtime
Hosted agents are containerized agent applications that run on Foundry Agent Service. Your code (any framework) handles orchestration and calls models from the catalog; the platform owns the endpoint, identity, scaling, session state and observability around it.
$HOME and /files.Architecture
Adapted from the architecture in the hosted agents documentation. Each session gets its own isolated sandbox; scaling happens per session, not per replica.
Compute and runtime, explained
0.5 vCPU
Light agents, simple tool orchestration.
1 vCPU
A balanced starting point.
2 vCPU
Heavier frameworks, parsing and in-memory work.
- Per session, not per replica. A new VM-isolated sandbox is created for each session on demand. There is no replica count to configure and no warm pool to size. The CPU and memory you set describe a single session.
- Right-size with data. Run a representative workload and watch CPU, memory and request duration in Application Insights (Investigate › Performance). If sustained peaks exceed about 70% of allocation, raise the next version; if they stay well below, lower it to cut cost. Versions are immutable, so retest after each change.
- Disk. Up to 20 GiB per session at 1 vCPU or larger (scaled down for smaller tiers); about 20% is reserved for the system. The rest is shared by your image,
$HOMEand other writable paths.
Compute follows the session, not the request. Click a state, or let it play.
Compute is running and requests are routed to it. $HOME and /files are available. Every request resets the idle timer.
No requests for the idle timeout (2 to 240 minutes, default 15). The platform deprovisions compute and persists session state.
The same session ID arrives again. New compute is provisioned and $HOME and /files are restored, so files written earlier are still there.
- The platform permanently deletes a session after 30 days of inactivity.
- Responses protocol: the conversation ID is primary and the platform keeps history. Invocations: the session ID is primary and you manage state (for example in Cosmos DB or the durable state store).
- A durable state store Preview holds keyed JSON items that survive crashes, restarts and idle eviction (default 30-day idle window), handy for framework checkpoints.
| Scenario | Protocol | Why |
|---|---|---|
| Chatbot or assistant; multi-turn Q&A with RAG or tools | Responses | Platform manages history, streaming and session lifecycle; any OpenAI-compatible SDK works. |
| Background or async processing | Responses | background: true with platform-managed polling and cancellation. |
| Published to Teams or Microsoft 365 | Responses + Activity | The platform bridges Responses to Activity for channel delivery. |
| Webhooks (GitHub, Stripe, Jira); classification, extraction, batch | Invocations | Arbitrary JSON in and out; you cannot change the sender's payload. |
| Custom streaming (for example AG-UI) | Invocations | Raw SSE control. |
| Real-time voice | Invocations (WebSocket) | Bidirectional streaming; pair with Pipecat, LiveKit or Voice Live. |
| Agent-to-agent delegation | A2A | v1.0 GA, v0.3 preview. |
Not sure? Start with Responses. An agent can support several protocols at once, so the choice is not permanent.
Responses {project_endpoint}/agents/{name}/endpoint/protocols/openai/responses
Invocations {project_endpoint}/agents/{name}/endpoint/protocols/invocations
WebSocket wss://{account}.services.ai.azure.com/api/projects/{project}/agents/{name}/endpoint/protocols/invocations_ws?api-version=v1
A2A {project_endpoint}/agents/{name}/endpoint/protocols/a2a| Identity | Scope | Purpose |
|---|---|---|
| Agent identity (Entra ID) | Per agent, created at deploy | What the container authenticates with at run time: models, tools, downstream Azure services. |
| Project managed identity | Project-wide, system-assigned | Platform infrastructure work, for example reading your container registry. Not the agent's runtime identity. |
- The agent identity can reach model inference and session storage by default. For other resources (such as your own storage), assign RBAC roles to the agent's Entra identity.
- User-invoked calls can use OAuth 2.0 on-behalf-of with the user's delegated permissions. Autonomous calls use the agent's own identity.
- No secrets in images or environment variables. Use managed identities, connections and Key Vault.
- Private networking: deploy within network-isolated Foundry resources and send outbound traffic through your virtual network. Projects created after June 25, 2026 support a private Azure Container Registry.
- Network egress controls Preview in a guardrail limit which outbound destinations a hosted agent may reach.
- Write the agentUse Microsoft Agent Framework, LangGraph or your own code, with a protocol library that serves HTTP or WebSocket, health checks and OpenTelemetry.
- Package and pushBuild a container image and push it to Azure Container Registry.
- Create a versionWith the Azure Developer CLI (
azure.ai.agentservice inazure.yaml) or the Foundry SDK: image, CPU and memory, environment variables and protocols. Each call creates an immutable version. - Call the endpointLive as soon as it deploys; publishing is only for Teams and Microsoft 365.
- ObserveAn Application Insights connection string is injected automatically. Traces appear under Investigate › Transaction search.
- IterateShip a new version to change code, size, variables or protocols. An endpoint serves one version at a time with 100% of traffic; traffic splitting is not supported.
Hosted agents have full access to Foundry-managed tools through a Toolbox MCP endpoint (Code Interpreter, web search, Azure AI Search, OpenAPI, MCP, A2A, skills). With Microsoft Agent Framework use FoundryToolbox (Python) or AddFoundryToolboxes (.NET).
- Pricing: managed hosting runtime is billed on consumption of CPU and memory during active sessions. See the Foundry pricing page for current rates. You also pay for the models and tools the agent calls.
- Regions (31 at the doc date): Australia East, Brazil South, Canada Central and East, Central US, East US and East US 2, France Central, Germany West Central, Italy North, Japan East and West, Korea Central, North Central US, Norway East, Poland Central, South Africa North, South Central US, South India, Southeast Asia, Spain Central, Sweden Central, Switzerland North and West, UAE North, UK South and West, West Central US, West Europe, West US and West US 3.
- Languages: Python and C#.
- Third-party risk: third-party servers, code and non-Azure-direct models are used at your own risk and you own responsible AI mitigations.
Prompt agent or hosted agent?
| Prompt agent | Hosted agent | |
|---|---|---|
| Defined by | Instructions, model, tools | Your container image |
| You manage | Prompts and configuration | Code, image, dependencies |
| Frameworks | Managed by Foundry | Any (Agent Framework, LangGraph, Semantic Kernel, custom) |
| Compute control | None needed | CPU and memory per session |
| Custom protocols | Platform protocols | Invocations, WebSocket, Activity, A2A |
| Pick it when | Instructions and tools are enough | You need your own logic, dependencies or protocols |
Cost options, tokens and provisioned throughput (PTUs)
Foundry has no single price. It is a set of optional Azure services, so you pay for what you use: model tokens or reserved capacity, hosted agent runtime, search, storage, monitoring and more. This section explains the levers and gives you a calculator.
Where the money goes
Tokens: the unit of everything
Language and vision models break input into tokens. Text, image and audio workloads can all be metered in tokens, and the billing unit and rate vary by model, deployment type and meter. Quotas are expressed as tokens per minute (TPM) and requests per minute (RPM).
Estimate a month of tokens
Compare the deployment options
| Option | Billing | Latency SLA | Best for |
|---|---|---|---|
| Standard (Global, Data Zone, regional) | Pay per token | None | Development, test and production with variable or unpredictable traffic. |
| Priority processing | Pay per token at the priority rate | Defined target per model | Latency-sensitive production without a long commitment. |
| Provisioned (PTU) | Per PTU per hour, or Azure Reservations | Defined target per model | Mission-critical, high-scale production needing guaranteed throughput. |
| Batch | Discounted batch rate (50%) | None; 24-hour turnaround | Bulk, asynchronous work. |
| Flex processing Preview | Discounted token rates | None | Delay-tolerant workloads. |
| Developer | Pay per token | None | Fine-tuned model evaluation only. |
PTUs: reserved capacity
A provisioned throughput unit (PTU) is a fixed amount of model processing capacity held exclusively for your deployment, whether or not requests are being made. That gives predictable throughput and latency, instead of the shared capacity (and variable throughput) of standard deployments.
Quota
The maximum PTUs you may deploy per subscription, region and deployment type. A policy limit with no cost. Request more through the quota form (also on the Foundry quota page); approval can take several days.
Capacity
The PTUs actually available to deploy right now for a model version. Having quota does not guarantee capacity: if the region is short, creation fails. Check availability in the deployment experience or the model capacities API before you plan or buy a reservation.
Three factors turn your traffic into a PTU count:
- Request shapeRequests per minute, average input tokens and average output tokens.
- Output-to-input ratioOutput tokens need more capacity than input tokens. Each model has a ratio that expresses how many input tokens one output token is equivalent to.
- Cache rateThe fraction of input served from prompt cache. Cached tokens do not consume PTU capacity, so a higher cache rate lowers the PTUs you need.
The calculation normalizes these into one TPM figure and divides by the model's input-TPM-per-PTU value. Use the capacity calculator in the Foundry portal for a guided estimate.
- Hourly billing is flexible but not intended for steady production. A deployment that exists for 15 minutes is charged one quarter of the hourly rate.
- Azure Reservations give a discounted rate for a term commitment. Global reservations are not region-specific; Data Zone and Regional reservations are tied to the deployment's region.
- If deployed PTUs exceed the reservation quantity, the excess is billed at the hourly rate.
- Reservations can be canceled or exchanged, which might incur fees.
Spillover routes overage from a fully used provisioned deployment to a standard deployment, instead of returning 429.
- Whole deployment: set
spilloverDeploymentNameon the provisioned deployment to a standard deployment of the same model and version in the same resource. - Per request: send the
x-ms-spillover-deploymentheader. If spillover occurs, the response carriesx-ms-spillover-from-deployment. - If both are set, the deployment property wins.
Choose PTU when…
- Traffic is predictable and you can estimate RPM and token volumes.
- Users or systems need consistent, low latency.
- Volume is high enough that per-token billing gets expensive.
- It is a real-time experience: chat, copilots or agents.
Stay on pay as you go when…
- You are developing, testing or low volume.
- Traffic is highly variable and hard to size.
- You can combine both: provisioned for the baseline plus spillover for bursts.
Cost control checklist
What a CCU is and how to optimize it
Claude models in Foundry are billed in Claude Consumption Units (CCUs): a billing unit shared with Anthropic's other cloud platforms. CCU is billing only. You still call Claude with tokens and size workloads in tokens per minute, so the way to optimize CCUs is to optimize tokens.
| Topic | Detail |
|---|---|
| Billing unit | Claude Consumption Unit, used for invoicing all Claude models in Foundry. |
| CCU price | Fixed; published on the Claude offer on Azure Marketplace. Denominated in USD. |
| Conversion | Token usage is priced at Anthropic's per-model rates (the rate at the time of each call), discounts applied, then converted to CCU. |
| Cadence | Metered hourly, invoiced monthly in arrears. Pay as you go: no prepaid CCU credits. |
| MACC | CCU spend is MACC-eligible and decrements your Azure Consumption Commitment like other Marketplace consumption. |
| Discounts | Applied at the token-to-CCU step through Azure Marketplace private offers; per-model rates are possible. Not a separate invoice line. |
| Scope | New Claude deployments bill in CCU. Earlier deployments keep their existing per-model plan; create a new deployment to move. |
| Subscribe | From Azure Marketplace (Claude Platform on Foundry offer) or from the model catalog in the portal. |
1 · Pick the right model
Match the model to the task. Claude models range across Haiku, Sonnet, Opus and preview families; the docs note that Opus 5.5 has lower per-token prices and less expensive cache reads. Use model router in Cost mode to route simple prompts to cheaper models (deploy Claude first so it can be routed to).
2 · Control thinking with effort
Newer Claude models use adaptive thinking (the only thinking mode on 4.7 and later) and an effort parameter that trades thoroughness for token efficiency. Lower effort for routine steps; raise it only where quality needs it. Some models also support token budgets (task_budget) and per-turn effort.
3 · Cache what repeats
Prompt caching (5-minute and 1-hour) reduces cost and latency for repeated context. Automatic prompt caching caches the last cacheable block with one parameter and moves the cache point as conversations grow. Cache reads do not count toward your input tokens-per-minute quota.
4 · Keep context lean
Context editing clears old tool results and manages thinking blocks automatically. Tool search loads tools on demand (regex and BM25) so thousands of tools do not fill the window. Use token counting to know a prompt's size before you send it.
5 · Retrieve less, better
Ground with a focused knowledge base (Foundry IQ) and cap retrieval. Smaller, more relevant context is fewer input tokens on every call.
6 · Operate with discipline
Retry 429s with exponential backoff, track token use and request patterns, and use the least expensive suitable model. Monitor per-model tokens in the Foundry Monitor tab.
7 · Optimize the commercial side
Ask your Microsoft or Anthropic team about a Marketplace private offer for per-model discounts, and remember CCU counts against MACC.
8 · Optimize the agent itself
Use the agent optimizer to shorten and sharpen instructions and tool descriptions, and to compare models on quality versus cost against your dataset.
CCU does not change how you size Claude workloads. Plan with RPM, ITPM (uncached input tokens per minute) and OTPM (output tokens per minute), per model.
- Subscription-level pools. All Global Standard deployments of the same model and version in a subscription share one quota pool across regions. Data Zone Standard deployments share a pool within each data zone (for example the US zone).
- Cache-aware ITPM. For most Claude models only uncached input counts: input after the last cache breakpoint plus cache-creation tokens (5-minute or 1-hour). Cache-read tokens do not count, which makes caching a throughput lever as well as a cost lever.
- Default limits depend on your subscription type (pay-as-you-go, Enterprise and MCA-E, Free Trial). Some preview models start at zero until you request quota.
| Surface | What you see |
|---|---|
| Azure Cost Management | Actual billed usage and cost, aggregated under the single CCU meter (not split by model). |
| Foundry portal › Pricing tab | Discover › Models › a Claude model › Pricing, linking to Claude pricing. |
| Foundry portal › Monitor tab | Per-model token usage and request counts. For CCU deployments, an estimated cost chart. |
| Marketplace private offer | Your contracted pricing, reflected in billed CCU. |
Operate and observe: tracing, monitoring, alerts
Tracing, monitoring and evaluation share one data model. Foundry captures inputs, outputs, tool usage, retries, latencies and token consumption for every run, so you can answer "where did this response come from?" and "which step added the latency?"
Traces are built from spans (single operations, nestable) with attributes, following the OpenTelemetry GenAI semantic conventions (development status, may change). Microsoft and Cisco Outshift contribute conventions for multi-agent workflows, integrated in Foundry, Microsoft Agent Framework, LangChain and LangGraph.
Build › Agents › your agent › Monitor tab Preview. Summary cards on top, charts below, for the selected time range.
| Metric | Read it as |
|---|---|
| Token usage | High usage can mean verbose prompts or responses worth optimizing. |
| Latency | Above about 10 seconds can indicate model throttling, complex tool calls or network issues. |
| Run success rate | Below about 95% warrants investigating failed runs. |
| Evaluation metrics | Scores from evaluators on sampled outputs; interpretation varies by evaluator. |
| Red teaming results | Outcomes of scheduled scans; failed scans indicate risks to remediate. |
Data is stored in your connected Application Insights resource, so retention and billing follow its configuration. For log-based views you also need Log Analytics Reader.
Assign the project's managed identity the Foundry User role so continuous evaluation rules can run. A Notification Center and Insights surface issues and suggested improvements, and the fleet-level Operate panes add cost and token anomaly tracking.
| Pane | Use it to |
|---|---|
| Overview | See fleet health, cost trends, run completion rate and prevented behaviors; drill into anomalies. |
| Assets | Search every agent, model and tool across projects; sort by health score, cost, alerts and token use; open Evaluation or Monitoring; see recommendations; correlate logs with evaluation results. |
| Compliance | Define, apply and monitor guardrail policies (next sections). |
| Tracing | Inspect runs across projects. |
| Quota | See which deployments use how much quota; toggle Show all to check available regions and capacity before deploying. |
The control plane can also register custom agents from other platforms so you see Foundry, Microsoft and non-Microsoft agents in one fleet view.
- Connect Application Insights to the projectTracing and the Monitor dashboard read from it.
- Grant accessLog Analytics Reader (and Privileged Monitoring Data Reader if tables are protected).
- InstrumentPrompt and hosted agents emit traces by default; for your own code use OpenTelemetry with the Foundry SDK, or framework integrations.
- Open Operate › Tracing and the agent's Monitor tabVerify spans, tokens and latency.
- Turn on continuous evaluation and alertsUse the gear icon in Monitor settings.
Evaluations and AI red teaming
Evaluation measures the quality, safety and reliability of models and agents throughout development and production. An evaluation applies one or more evaluators to your data or application, producing scores and explanations that let you compare versions and decide if something is ready.
The built-in evaluator catalog
| Evaluator | Measures |
|---|---|
| Coherence | Logical consistency and flow of responses. |
| Fluency | Natural language quality and readability. |
| Evaluator | Measures |
|---|---|
| Retrieval | How effectively the system retrieves relevant information. |
| Document Retrieval | Retrieval accuracy given ground truth. |
| Groundedness | How grounded the response is in retrieved context (1 to 5, model-based). |
| Groundedness Pro Preview | Pass or fail via Azure AI Content Safety; needs no model deployment. |
| Relevance | How relevant the response is to the query. |
| Response Completeness Preview | Whether the response misses critical information versus ground truth. |
| Evaluator | Measures |
|---|---|
| Task Adherence Preview | Whether the agent follows through on identified tasks per system instructions. |
| Task Completion Preview | Whether the agent completed the requested task end to end. |
| Intent Resolution Preview | How accurately the agent identifies and addresses user intent. |
| Customer Satisfaction Preview | Helpfulness, completeness, clarity, tone, resolution and adaptability across a conversation. |
| Task Navigation Efficiency | Whether the agent's sequence of steps matches an optimal or expected path. |
| Tool Call Accuracy · Tool Selection · Tool Input Accuracy | Quality of tool calls, choice of the most appropriate tool, and strict correctness of parameters. |
| Tool Output Utilization · Tool Call Success | Whether tool outputs are used correctly, and whether calls ran without technical failures. |
| Quality Grader · Output Quality · Tool Use Quality Preview | Batched judges that score several dimensions in one call instead of running each evaluator separately. |
| Evaluator | Detects |
|---|---|
| Hate and unfairness · Sexual · Violence · Self-harm | Harmful content categories. |
| Protected materials | Unauthorized copyrighted or protected content. |
| Indirect attack (XPIA) | Falling for an indirect jailbreak injected through retrieved context. |
| Code vulnerability | Security issues in generated code. |
| Ungrounded attributes | Fabricated information inferred from interactions. |
| Prohibited actions · Sensitive data leakage | Agent behaviors that violate disallowed actions, or expose sensitive information. |
- Textual similarity: Similarity (AI-assisted), F1, BLEU, GLEU, ROUGE and METEOR against ground truth.
- Azure OpenAI graders and rubric evaluators for criteria-based scoring.
- Custom evaluators for your own pass/fail logic or model-judged criteria.
Ways to run them
AI red teaming
The AI Red Teaming Agent uses Microsoft's open-source PyRIT framework plus Foundry's risk and safety evaluators to automate three things: scan (simulated adversarial probing), evaluate (score each attack-response pair into an Attack Success Rate) and report (a scorecard you can track over time in Foundry).
- Use it at design (pick the safest model), development (upgrade or fine-tune), pre-deployment, and post-deployment with scheduled continuous red-teaming on synthetic adversarial data.
- Supports models and agents, local and cloud runs; text-based scenarios only. Categories include hateful and unfair, sexual, violent, self-harm, protected materials, code vulnerability and ungrounded attributes.
- It complements, not replaces, guardrails: in production keep content filters and safety system messages, and use the control plane to govern agent fleets.
Guardrails and controls
A guardrail is a named collection of controls. Each control defines a risk to detect, the intervention points to scan, and the action to take. Guardrails apply to models and, for agents, at four intervention points that cover the whole agent loop.
Guardrails applied only at the model leave tool traffic exposed. Agent guardrails close that gap. Each active intervention point adds roughly 50 to 100 ms of latency.
| Risk | Models | Agents Preview |
|---|---|---|
| Hate · Sexual · Self-harm · Violence | Yes | Yes |
| User prompt attacks (jailbreak) | Yes | Yes |
| Indirect attacks (XPIA) | Yes | Yes |
| Protected material for text and code | Yes | Yes |
| Personally identifiable information Preview | Yes | Yes |
| Task adherence Preview | Yes | Yes |
| Spotlighting Preview | Yes | No |
| Groundedness detection Preview | Yes | No |
Tool call and tool response controls need moderation support from the tool itself. Supported today: Azure AI Search, Azure Functions, OpenAPI, SharePoint grounding, Fabric data agent, Bing grounding, Bing Custom Search and Browser Automation.
| Blocking level (content harms) | Blocks |
|---|---|
| Off | Nothing (may still annotate). Off for inputs is available to all; off for outputs needs approval for modified guardrails. |
| Low | High-severity only. Least restrictive. |
| Medium | Medium and high severity. |
| High | Low, medium and high severity. Most restrictive. |
- Actions: Annotate (models only) or Annotate and block (models and agents).
- Override rule: an agent uses the guardrail assigned to the agent; it fully overrides the model's guardrail. If the agent's guardrail has no control for a risk at a point, that point is not scanned for it.
- Classification models can produce false positives and negatives: evaluate controls with content representative of your workload.
Foundry Models include DefaultV2 safety by default, for every model except transcription models.
- Core harm filters (hate and fairness, violence, sexual, self-harm) are on, at Medium, for prompts and completions.
- User prompt attack (jailbreak) detection is on for prompts; protected material (text and code) is on for completions.
- Document attack detection is off by default and must be enabled.
- Blocked input returns an error response; blocked output can return a filtered completion.
- Open Build › Guardrails (or Operate › Compliance)You need the Foundry Account Owner role.
- Create a guardrail and add controlsFor each: choose the risk, intervention point (for example Indirect attack at Tool response), action and blocking level. A Guided Guardrail experience is in preview.
- Assign itOne guardrail can apply to many models and many agents in a project. Controls not relevant to models (tool call, tool response) simply do not run on them.
- Test, then evaluateProbe with the AI Red Teaming Agent and run safety evaluators.
- Enforce fleet-wideUse guardrail policies (Azure Policy) to mandate minimum controls across a subscription or resource group (governance section).
Governance: identity, policy, compliance and the control plane
As you move from isolated copilots to fleets of autonomous agents, you need one place to see them, set the rules and prove compliance. Foundry layers identity, network, data protection, policy and security signals, and surfaces them in the Foundry Control Plane Preview.
People
Microsoft Entra ID and Azure RBAC with Foundry roles that separate control plane from data plane (User, Project Manager, Account Owner, Owner). Prefer keyless authentication. Elevated-role tasks and the option to disable preview features are documented for administrators.
Agents
Each agent gets a Microsoft Entra agent identity under an agent identity blueprint. It starts with no permissions; you grant least-privilege RBAC on the target services. Agents authenticate to tools without secrets in prompts or code.
Callers
Agent endpoint authorization controls who can call an agent (Azure RBAC, agent blueprint, Bot Service schemes). API keys are not supported for agent endpoints.
Users, delegated
User delegation for tools uses OAuth on-behalf-of and Microsoft Entra consent so tools act with the user's permissions, not a broad service identity.
- Network: choose a networking option, then configure private link or a managed virtual network; reach on-premises resources; add Foundry to a network security perimeter. Hosted agents and the publishing flow have virtual-network paths.
- Encryption: understand and configure customer-managed keys.
- Secrets: store them in your own Azure Key Vault through a connection; rotate API access keys where keys still exist.
- Data residency: data at rest stays in the chosen geography; processing depends on the deployment type (global, data zone, regional).
- Standard agent setup: keep agent files, vector stores and conversation state in your own Storage, AI Search and Cosmos DB.
- Built-in policy definitions for AI services and Foundry, plus a built-in policy for model deployment (control which models may be deployed) and custom policy definitions.
- Govern model router with Azure Policy to restrict which models it may route to.
- Guardrail policies mandate minimum guardrail controls for deployments across a subscription or resource group.
- Creating or editing guardrail policies needs Owner or Resource Policy Contributor at subscription or resource-group scope. Most users can still view compliance status.
Operate › Compliance. Use the subscription and project filters first, then switch tabs.
| Tab | Outcome |
|---|---|
| Policies | Review guardrail policies, check compliance, create or edit enforcement rules. Select a non-compliant policy, pick an asset, then Fix now. |
| Assets | Inspect model deployments, see policy violations, jump to remediation. |
| Guardrails | Compare guardrail configurations across deployments and spot coverage gaps. |
| Security posture | Defender for Cloud recommendations and Microsoft Purview enablement. |
Compliance status updates within a few minutes of saving a fix. Use the latest agent versions for full support.
Together they address prompt injection, sensitive data leakage and model misuse in a defense-in-depth model, and alerts appear on the control plane dashboard.
- Manage agents at scale across supported platforms: filter, drill into evaluation and monitoring, act on recommendations.
- Register custom agents from other platforms into the control plane registry (preview) and route them through the AI gateway.
- Agent availability for administrators: use Agent 365 and Microsoft Entra governance actions, with Azure infrastructure intervention as the emergency path.
- Schedule red-team scans and drift monitoring for ongoing agent testing.
- Transparency notes for Azure OpenAI and for Foundry Agent Service; data, privacy and security pages for models and agents; a code of conduct; abuse monitoring; content provenance and text watermarking for supported models.
- High availability and disaster recovery guidance, including recovery from platform outage and from resource and data loss, and a Foundry security baseline.
- Model lifecycle: track retirement dates so a governed fleet does not depend on a retired model.
AI Gateway: tiers, limits and every capability
AI Gateway puts Azure API Management (APIM) between clients and your Foundry models and tools. It gives you per-project token limits and quotas, centralized policy, observability and a governed entry point for MCP tools and custom agents.
Limits apply per project on the shared gateway. Policies are enforced in API Management; the Foundry portal handles setup and token limits.
API Management tiers for AI Gateway
| Tier | Role in Foundry AI Gateway (per the docs) |
|---|---|
| Basic v2 | What the portal creates when you choose Create new. Designed for development and testing with SLA support. Typically provisions in 5 to 10 minutes. |
| Standard v2 | Recommended for production or higher throughput when you bring an existing instance. For a private Foundry resource, use it with a private endpoint. |
| Premium v2 | Production and higher throughput. For a private Foundry resource, use it with a private endpoint, or injected into a virtual network. |
| Classic tiers (Developer, Basic, Standard, Premium) and Consumption | Not selectable as an existing instance. When you choose Use existing APIM, only instances in a v2 tier appear, in the same Entra tenant and subscription as the Foundry resource. |
- Check permissionsContributor or Owner on the resource group (to create APIM) or API Management Service Contributor on an existing instance; Foundry Account Owner or Owner on the Foundry resource.
- Manage › AI Gateway › Add AI GatewayPick the Foundry resource.
- Create new or Use existing APIMCreate new makes a Basic v2 instance. Existing instances must be a v2 tier, in the same tenant and subscription.
- Name it and AddWait until the status is Enabled.
- Add projectsNew projects in the resource have the gateway enabled by default. Existing projects need Add project to gateway.
Manage › AI Gateway › your gateway › Token management › + Set limit: choose the project and deployment, then enter a tokens-per-minute value.
TPM rate limit
Caps consumption per minute. Exceed it and the caller gets 429 Too Many Requests.
Total token quota
Caps consumption per period (hourly, daily, weekly, monthly or yearly). Exceed it and the caller gets 403 Forbidden.
- Use it for multi-team containment, cost control by capping aggregate usage, and compliance ceilings.
- Concurrent requests can briefly exceed a limit until responses are processed. New limits apply immediately to later requests.
- If latency rises after enabling, compare against calling the model directly; check APIM region versus the resource region and cold start.
| Capability | How APIM does it |
|---|---|
| Token rate limiting and quotas | llm-token-limit policy: a TPM limit or a token quota over hour to year, on any counter key (subscription key, IP, or expression); can precalculate prompt tokens to skip calls that already exceed the limit. |
| Token metrics | llm-emit-token-metric policy: emit consumption with custom dimensions to Application Insights and Azure Monitor. |
| Semantic caching | llm-semantic-cache-lookup and llm-semantic-cache-store with Azure Managed Redis (or a compatible RediSearch cache) and an embeddings API; reuses completions for similar prompts. |
| Load balancing | Backend pool with round-robin, weighted, priority-based or session-aware balancing, for example prioritizing PTU backends. |
| Circuit breaker | Stops sending to unresponsive backends; trip duration follows the backend's Retry-After header. |
| Logging | Log tokens, prompts and completions for billing and audit; built-in dashboard in APIM. |
| Scale | Automatic or manual scale units and regional gateways, depending on tier. |
| Developer experience | Self-service for teams; credential manager for OAuth to APIs and MCP servers; unified model API (preview). |
<!-- 500 tokens per minute per subscription key -->
<llm-token-limit counter-key="@(context.Subscription.Id)"
tokens-per-minute="500" estimate-prompt-tokens="false"
remaining-tokens-variable-name="remainingTokens" />
<!-- emit token metrics to Application Insights -->
<llm-emit-token-metric namespace="llm-metrics" />Route MCP traffic through the gateway Preview for a single governed entry point with authentication, rate limits, IP restrictions and audit logging, without modifying your MCP servers or agent code.
- Only new MCP tools created in the portal that do not use managed OAuth are routed through the gateway. The tool's endpoint then shows the APIM URL instead of the server URL.
- Supported MCP auth: managed identity (Entra), key-based, custom OAuth identity passthrough, or unauthenticated where applicable.
- Apply policies in APIM: rate limit, IP filter, correlation ID header, and removal of sensitive headers (Cookie, Referer).
- Register custom agents from other platforms in the control plane and govern them through the same gateway.
- Bring your own model: connect models hosted behind your own gateway (APIM or a non-Azure gateway) to Foundry Agent Service, keeping control of the endpoint.
<inbound> <base /> <rate-limit-by-key calls="60" renewal-period="60" counter-key="@(context.Request.IpAddress)" /> <set-header name="X-Correlation-Id" exists-action="override"><value>@(context.RequestId)</value></set-header> </inbound>
- Check metricsAzure portal › your APIM › Monitoring › Metrics › Requests. Make a test call and watch the count rise.
- Turn on logsDiagnostic settings › Logs related to ApiManagement Gateway › Log Analytics, resource-specific tables.
- Query
ApiManagementGatewayLogs | where TimeGenerated > ago(1h). Look for 200 responses with your API name. - Test limitsExceed the TPM limit (429) and the quota (403) on purpose.
| Symptom | Likely cause |
|---|---|
| Gateway not listed after creation | Still provisioning; wait a few minutes (Basic v2 is typically 5 to 10). |
| Project shows Disabled; requests bypass | Existing projects are not auto-enabled; add the project to the gateway. |
| Existing APIM not in the list | Not a v2 tier, different tenant or subscription, or missing permissions. |
| Permission error creating the gateway | Missing Contributor/Owner or API Management Service Contributor. |
Reference library and your pointers
Every link below opens the official Microsoft Learn page for the topic. Start with the capability map, then jump to the area you need.
Start here
Build agents
Models and cost
Your pointers
Add your customer-specific pointers here. This box is editable in the browser for live sessions; to keep notes permanently, add them to src/sections/21-references.html and rebuild.
- Customer priorities and success criteria
- Preferred models and regions
- Security and networking requirements
- Next steps and owners
Keep this guide fresh
- The Foundry docs are reviewed on a rolling cycle and renamed pages redirect, so re-run
python build.py --checkbefore each customer session to confirm every link still resolves. - Items tagged Preview can change; confirm status on the linked page.
- This guide uses the canonical path
learn.microsoft.com/azure/foundry/…(olderai-foundrylinks redirect here).