Overview
Microsoft Foundry · customer guide

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.

10,000+models in the catalog
3agent styles: prompt, workflow, hosted
1,000+connectors in the tool catalog
4guardrail intervention points
Your apps Teams & Copilotpublished agents Other agentsA2A, MCP clients MICROSOFT FOUNDRY RESOURCE PROJECT Agents Prompt Workflow Hosted (your code) Modelscatalog & deployments Toolstoolbox, MCP, connectors KnowledgeFoundry IQ Memorylong-term recall Control plane · observability · evaluations · guardrails · governance Your data SaaS & APIsconnectors, OpenAPI Azure servicessearch, storage, functions

Consumers call agents. Agents use models, tools, knowledge and memory inside a project. A control plane watches and governs everything.

01 · What Foundry is

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.

AgentsDeclarative prompt agents (including voice), workflows, and hosted agents that run your own code in a managed runtime.
ModelsMore than 10,000 models from Microsoft, OpenAI, Anthropic, Meta and others, deployed with the billing and residency option you choose.
Tools & knowledgeA Toolbox packages tools behind one MCP endpoint; Foundry IQ and memory ground agents in your content and context.
ObservabilityTrace and monitor agents and models, with dashboards for tokens, latency, success rate and evaluation scores.
GuardrailsContent safety controls applied at four intervention points on models and agents.
GovernanceControl plane, Entra identity, Azure Policy, Defender, Purview and an AI Gateway for token limits.

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.

Prompt agentInstructions + model + tools, defined in the portal or SDK. Foundry hosts and runs it. Nothing to deploy.
Workflow agent PreviewOrchestrates several agents and steps when one task spans more than one agent.
Hosted agentYour code and framework (Agent Framework, LangGraph, Semantic Kernel, custom) packaged as a container. Foundry gives it an endpoint, identity, scaling and observability.
Not building an agent yet? If you only need to send prompts to a model with no tools or orchestration, start with a single model call. Add an agent later only if you need tools or orchestration.

Product and capability map

CapabilityWhat it isReach for it when
Foundry portalWeb experience for models, agents, evaluations and resources.You want to explore and prototype without code.
Prompt agentsDeclarative agents: instructions, a model and tools.You want an agent with no runtime to manage.
Hosted agentsYour own agent code or framework, run by Foundry.You need full control of logic and dependencies.
Foundry ModelsCatalog of models from Microsoft, OpenAI, Anthropic, Meta and others.You are choosing and deploying the model behind an app or agent.
Fine-tuningCustomize a model on your data.Prompting and retrieval cannot reach the quality you need.
ToolboxOne managed endpoint that packages the tools an agent can call.You want to give agents actions and govern tools centrally.
Foundry IQAgentic retrieval over a knowledge base.You want answers grounded in your content.
Memory PreviewPersistent agent recall across sessions.An agent must remember prior turns or user context.
Evaluations / AI red teamingScoring and automated adversarial scans.You need to measure quality and probe for unsafe behavior.
Guardrails and controlsContent filters and safety controls for models and agents.You want to enforce safety at run time.
Foundry control plane PreviewGovernance for agents, models and tools across your estate.You manage many projects and need policy and oversight.
Naming you may still see. The platform evolved from Azure AI Studio to Azure AI Foundry to Microsoft Foundry. Azure AI Services became Foundry Tools. The Azure resource type is still 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).
02 · Know your way around

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.

New Foundry
Scope mattersHome, Discover, Build act on the project you selected. Operate spans all projects. Manage targets the selected project and its parent resource.
Switch projects firstUse the project name dropdown in the upper left before acting on a different project, especially in Manage.
The UI movesThe Foundry portal is updated frequently. If a step does not match, look for the equivalent option in the current UI.

Classic portal to current portal

You used to…Classic portalNow
View model deploymentsModels + endpointsBuild › Models
Browse the catalogModel catalogDiscover › Model catalog
Build agentsAgentsBuild › Agents
Run evaluationsEvaluationBuild › Evaluations
Trace and monitorTracingOperate › Tracing
Manage quotaManagement center › QuotaManage › Quota
Manage usersManagement center › UsersManage › Project details › Users
Guardrails and content filtersGuardrails + controlsOperate › Compliance (and Build › Guardrails)
Terminology changed too. Threads are now Conversations, runs are Responses, the Assistants API became the Responses API, and agents are versioned (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.
03 · Your first step

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.

AZURE SUBSCRIPTION RESOURCE GROUP Foundry resourcekind: AIServices · custom subdomain · system-assigned identity · allowProjectManagement Project Aagents · evals · filesown endpoint & limits Project Bagents · evals · filesown endpoint & limits + more projects Model deployments (shared) Networking · policy · AI Gateway

Many projects, one resource: shared models, networking and governance, separate agents and project-level access.

  1. 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.
  2. Select the project name (upper left), then Create new projectGive it a name and select Create project.
  3. 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.
  4. 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).
The portal path uses basic defaults. If your organization needs custom names, security controls or cost tags that satisfy Azure Policy, use the Azure portal or a template instead.

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.

RoleUse it for
Foundry UserLeast-privilege role for developers building and testing agents; data actions on the project.
Foundry Project ManagerManage projects, build, and conditionally assign Foundry User to others.
Foundry Account OwnerFull access to manage projects and resources; can conditionally assign Foundry User, ACR and monitoring roles.
Foundry OwnerAccount Owner plus building with projects; highly privileged, self-serve.
Renamed roles. Foundry User, Owner, Account Owner and Project Manager were previously Azure AI User, Owner, Account Owner and Project Manager. Role IDs and core permissions are unchanged, and you may still see the old names while the rename rolls out.

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 ownWhat it stores
Azure StorageFiles uploaded by developers and end users
Azure AI SearchVector stores created by agents
Azure Cosmos DB for NoSQLMessages, conversation history and agent metadata (at least 3000 RU/s)
Azure Key VaultSecrets management

Pair it with network isolation (private link or managed virtual network) when you need to keep traffic off the public internet.

04 · Choose and deploy

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.

TypeSKU codeData processingBillingBest for
Global StandardGlobalStandardAny Azure regionPay per tokenGeneral workloads, highest quota
Data Zone StandardDataZoneStandardWithin the data zone (US, EU, APAC)Pay per tokenZone compliance
StandardStandardWithin an Azure geographyPay per tokenGeography compliance, low volume
Global / Data Zone / Regional ProvisionedGlobalProvisionedManaged · DataZoneProvisionedManaged · ProvisionedManagedGlobal / zone / geographyReserved PTUPredictable high throughput
Global / Data Zone BatchGlobalBatch · DataZoneBatchGlobal / zone50% discount, 24 hLarge async jobs
DeveloperDeveloperTierAny regionPay per tokenFine-tuned model evaluation only (24 h, no SLA)
Start with Global Standard. It launches first when a new model releases, has the lowest price, and the broadest region coverage. Move only for a specific reason: data residency, reserved throughput, or asynchronous batch.

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.

Your promptone deployment name Model router reads complexity, reasoning,task type Small, fast model Reasoning model Large general model Other provider (e.g. Claude) ROUTING MODE Balanced (default)cheapest within ~1–2% quality Costcheapest within ~5–6% quality Qualityhighest quality, ignores cost

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

Instant access PreviewCall a supported model by name with no deployment. West US 3 only during preview.
Fine-tuningTraining, hourly hosting (even when idle) and per-token inference are charged. Remove deployments you do not need.
BenchmarksLeaderboards and compare-models in the catalog help you shortlist before you evaluate on your own data.
Bring your own modelConnect models behind your own AI gateway to use Foundry agent capabilities. You own responsible-AI mitigations for those models.
LifecycleModels move from preview to GA to legacy and retirement. Check the lifecycle policy before you commit a long-lived workload to a model version.
Keyless by defaultUse Microsoft Entra ID with the openai package against the project endpoint; API keys are optional.
05 · Frontier models

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.

Names and availability change quickly. The lineup below reflects the Microsoft Learn model pages read in October 2026. Treat it as a map of families and access paths, and confirm exact model IDs, regions and lifecycle on the linked pages before presenting.

Azure OpenAI in Foundry models are sold by Azure. Model highlights listed in the docs include these series (newest first):

GPT-6.1 · GPT-6gpt-6.1-sol, gpt-6-astra, gpt-6-luna, gpt-6-sol
GPT-5.6 · GPT-5.5gpt-5.6-sol, -terra, -luna; gpt-5.5
GPT-5.4 and earlier 5.x5.4 (mini, nano, pro), 5.3 and 5.2 codex, 5.1, and the original GPT-5 series
Chat-latest Previewgpt-chat-latest with dated preview versions
Open-weight and othersgpt-oss, GPT-4.1, o-series reasoning, GPT-4o, embeddings, image, video (sora-2) and audio
Limited accessSome models (for example computer-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 AzureHosted on Anthropic infrastructure
Where it runsAzure infrastructure end to end (all GA)Anthropic infrastructure, outside Azure
Deployment typesGlobal Standard and Data Zone Standard (US)Global Standard only
Data residencyAt rest in your Azure geography; processing scoped to global or data zoneMay be processed outside the selected Azure region
APIsMessages, token countingAdds /files and /skills and more capabilities
ModelsOpus 5.5 (and Fast), Opus 5, Opus 4.8, Sonnet 5 and 5.5, Haiku 5.5 and 4.5Those 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):

xAI GrokRegistration is required for access to grok-4 and grok-code-fast-1.
DeepSeek · Meta · Mistral AI · CohereAvailable as collections; check each model card for deployment type and region.
Black Forest LabsImage generation models with their own how-to.
Hugging Face · FireworksOpen models and custom model import paths.
Healthcare AI modelsSpecialized medical imaging and related models.
Partner termsPartner models are Non-Microsoft Products governed by the provider's terms. Review data handling before you deploy.

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:

1DiscoverCatalog, filters,benchmarks 2SubscribeMarketplace offerfor partner models 3RegisterLimited-accessmodels only 4QuotaCheck, or requestmore (takes days) 5DeployPick type, region,guardrail 6CallEntra ID, projectendpoint Models sold by Azure usually start at step 4. Partner models start at step 2.

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.

06 · Declarative agents

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.

User inputtext, files, images FOUNDRY AGENT SERVICE Agent (version 3) Model deployment Instructions Tools · knowledge · memory Conversationdurable history: messages, tool calls, outputs Responseone run of the agent; streamed or background Answerwith citations / actions

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.

  1. Deploy a modelAn agent needs a deployed model. Any Foundry direct model works; gpt-5-mini is used in the quickstart.
  2. Build › Agents › CreateName the agent and choose the model deployment.
  3. Write instructionsDefine role, tone, what the agent must and must not do, and how to use its tools. Keep them specific and testable.
  4. Add tools and knowledgeAttach a toolbox, MCP servers, file search, Foundry IQ, memory, web search, code interpreter and more (see the tools section).
  5. Test in the playgroundChat, inspect tool calls, adjust, and save. Each save is a new version.
  6. 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.

ProtocolPath under /agents/{agent}/endpoint/protocols/
Responses (default)openai/responses
Activity (Teams, Microsoft 365)activityprotocol
Invocationsinvocations
A2A v1.0 GA · v0.3 previewa2a
MCP Previewmcp
  • Version routing. By default 100% of traffic goes to the latest version. Pin a version with a version_selector when 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).
07 · Ground the answer

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.

Questionfrom a user Agentdecides to retrievethen composesthe answer File searchfiles you upload Azure AI Search toolyour existing index Foundry IQmulti-source knowledge base Vector store Search index Blob · SharePointOneLake · Web Citedanswer

Pick the lightest path that fits. You can combine them on one agent.

PathBest whenWhat you manage
File searchA 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 toolYou already have a search index, or need custom indexing and ranking.Your index and its connection to the project.
Foundry IQ knowledge baseSeveral 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 groundingFresh public information.Tool configuration; review data-sharing for web tools.

Build one, step by step

  1. 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.
  2. Create the knowledgeUpload files (Build › Data), or create a knowledge base (Build › Knowledge) with a search service and one or more knowledge sources.
  3. Create the agent and attach the knowledgeIn Build › Agents, add the file search tool, the Azure AI Search tool, or connect the knowledge base.
  4. Instruct for groundingTell the agent to answer only from retrieved content, to cite sources, and to say when it does not know.
  5. Test with hard questionsInclude questions with no answer in your content, and questions a user should not be allowed to see.
  6. Evaluate retrieval and groundednessUse the RAG evaluators: Retrieval, Document Retrieval, Groundedness, Relevance and Response Completeness. Gate releases on the scores.
Pick the right memory of the world. Use memory for what an agent learns about a user over time, a Foundry IQ knowledge base for curated organizational content, and file search for documents a user provides during an interaction.
08 · Knowledge layer

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.

GA vs preview. Some Foundry IQ features are generally available while others remain in preview, depending on the Search Service REST API version you use. The Foundry and Azure portals provide preview access to all agentic retrieval features. Check the migration guidance on the Foundry IQ page.
Agent querycaller's Entra identity Knowledge base1 · LLM plans the query2 · splits into subqueries3 · picks sourcesreasoning effort: min/low/med Azure Blob Storage SharePoint OneLake Indexed sources Public web Mergeparallel searchsemantic rerankenforce ACLs Extractive datawith citations

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.

Knowledge baseThe top-level resource. Defines which knowledge sources to query and how retrieval behaves, including the retrieval reasoning effort (minimal, low or medium).
Knowledge sourcesConnections to indexed or remote content: Blob Storage, SharePoint, OneLake and the public web. A knowledge base references one or more.
Agentic retrievalMulti-query pipeline with an optional LLM for query planning; keyword, vector or hybrid queries across indexed and remote sources.
Automated ingestionChunking, vector embeddings and metadata extraction for indexed sources, with scheduled indexer runs for incremental refresh.
PermissionsSynchronizes ACLs for supported sources, honors Microsoft Purview sensitivity labels, and runs queries under the caller's Microsoft Entra identity.
CitationsReturns extractive data with citations so agents reason over raw content and answers trace back to documents.

Set it up

  1. Open Build › KnowledgeMake sure New Foundry is on and select your project.
  2. 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.
  3. Create a knowledge baseAdd one knowledge source at a time, then configure retrieval behavior.
  4. Build › Agents: connect the knowledge baseCreate or select an agent and connect it. Refine in the playground.
The playground is a simplified proof-of-concept path. When you move to code, configure managed identities and permissions to match your security requirements.

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.

Foundry IQManaged knowledge layer for enterprise data across Azure, SharePoint, OneLake and the web.
Fabric IQ PreviewSemantic layer for Microsoft Fabric: ontologies, semantic models, graphs and data agents over OneLake and Power BI.
Work IQ PreviewContextual intelligence for Microsoft 365: signals from documents, meetings, chats and workflows.

Each is standalone, and you can use them together for broader organizational context.

09 · Continuity Preview

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.

Conversationtoday's session 1 · Extractpreferences, facts, context 2 · Consolidatemerge duplicates, resolve conflicts Memory storeitems scoped per user 3 · Retrievesearch for relevant memories Next sessionpersonalized from turn one

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

TypeWhat it holdsRetrieve…
User profileDurable preferences and personal context: language, defaults, accessibility needs.Near the start of each conversation, for stable personalization.
Chat summaryDistilled summaries of earlier topics and threads.Per turn, using the current messages, for continuity.
ProceduralReusable 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.
100scopes per memory store
10,000memories per scope
1,000/minsearch requests
1,000/minupdate requests
  • 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.
10 · Improve automatically

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.

Optimization runruns in the cloud 1 · Baselinescore your current agent 2 · Generate candidatesrewrite instructions, tools, model 3 · Evaluatesame dataset, same evaluators 4 · Rankcomposite score 0.0 to 1.0, ★ best

You then promote the winning candidate to a new prompt-agent version, or apply it to your hosted agent's configuration and redeploy.

TargetWhat changesPrompt agentHosted agent
Instruction tuningRewrites and refines the system prompt.YesWhen an instructions.md exists
Skill improvementRefines reusable skill bodies, keeping their purpose.NoWhen a skills/ folder exists
Tool optimizationImproves function-calling tool and parameter descriptions (not types or required fields).YesWhen a tools.json exists
Model selectionTests the agent across candidate deployments for the best quality-to-cost trade-off.Pick models in the wizardmodel_search_space in eval.yaml
  1. Open the agent's Optimize tabBuild › Agents › your agent › Optimize. No code changes are required for prompt agents.
  2. Select the baseline versionThe prompt-agent version you will compare candidates against.
  3. Choose a datasetGenerate one from agent traces, pick an existing Foundry dataset, or upload one.
  4. Choose evaluation criteriaBuilt-in or custom evaluators for the behaviors you want to improve.
  5. 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.
  6. 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
Your tools really run. The optimizer invokes your agent against every task in the dataset. If the agent calls APIs, databases or third-party services, those calls execute on each evaluation run. Use test endpoints or mock the tools during optimization.
  • 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.
11 · Give agents actions

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.

Prompt agent Hosted agent LangGraph / custom Any MCP client Toolboxone MCP-compatible endpoint • centralized auth (Entra, OAuth)• guardrails on inputs and outputs• versioning and promotion• tool search for large catalogs• skills (preview)• observability MCP servers OpenAPI / REST Managed connectors Azure Functions Search · files · code Other agents (A2A) Your systemsSaaS, data, APIs

Toolboxes are created in Foundry but are not Foundry-bound: any MCP-compatible runtime or client can use one.

BuildCreate reusable collections of tools and skills; configure auth once.
DiscoverTool search Preview exposes two meta-tools (tool_search, call_tool) so hundreds of tools do not flood the context.
ConsumeConnect agents to a single endpoint; add or reconfigure tools without redeploying agents.
GovernApply authentication, guardrails, observability and version management at the toolbox level.

Every kind of tool

ToolWhat it does
MCPConnect to a remote Model Context Protocol server.
Web search · Grounding with BingFresh public information with citations.
File search · Azure AI SearchRAG over uploaded files or your search index.
Foundry IQ · Fabric IQ · Work IQKnowledge, analytics semantics and Microsoft 365 context.
Code interpreterRun code in a sandbox for calculations, files and charts.
OpenAPICall a REST API described by an OpenAPI spec.
Azure FunctionsInvoke your serverless functions.
Function callingYour app executes the function on the client side.
SharePoint · Fabric data agent PreviewGround in SharePoint or query through a Fabric data agent.
Browser automation · Computer useDrive a browser or UI (computer use is preview).
A2ADelegate to another agent.
Image generation · Reminder PreviewGenerate images; schedule reminders.
Foundry ToolsAzure 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.

  1. BrowseFind the connector in the Tools catalog (Build › Tools).
  2. ConnectAuthenticate to the service (API key, OAuth account or personal access token).
  3. Select actionsChoose which actions to expose as MCP tools.
  4. Add toolFoundry creates the managed MCP server and adds it to your agent or toolbox.
Publisher tierExamplesData responsibility
Microsoft (internal services)SharePoint, Teams, Dynamics 365Stays on Microsoft infrastructure
Microsoft (external services)GitHubMicrosoft policies in transit; external company's at the destination
Verified third partyDocusign, Databricks, BoxReview the publisher's privacy terms
Independent publisherCommunity connectorsLower 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.
12 · Meet users where they work

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.

Tested agentactive version chosen Foundry does for you 1 · validates name, description, version2 · compiles a Teams app manifest (.zip)3 · submits to the Copilot and Teamsagent catalogs4 · enables the Activity protocol5 · sets an authorization scheme (creates an Azure Bot Service resource) Just youBotServiceRbacno admin approvalappears only for you People in your orgBotServiceTenantadmin approval neededin M365 admin center UsersMicrosoft Copilotand Teams
  1. Test thoroughly in the portalConfirm responses and every tool work as expected.
  2. 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).
  3. Select Publish › Teams and Microsoft CopilotAn Azure Bot Service resource is created automatically, or shown read-only if one exists.
  4. 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).
  5. Choose the scopeJust you, or people in your organization.
  6. 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.
Microsoft 365 and Teams process and store some data about the published agent and its responses, under their own compliance and data-residency terms. Check that this fits your governance requirements before publishing.
ScopeAuthorization schemeApprovalVisibility
Just you (portal) · Shared (REST)BotServiceRbacNoneOnly you; in a Teams chat, participants with the required Foundry permissions on the project can use it.
People in your organization · TenantBotServiceTenantAdmin, in the Microsoft 365 admin centerEveryone 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.
13 · Bring your own code

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.

Bring your own codeAgent Framework, LangGraph, Semantic Kernel or fully custom, in Python or C#.
Custom protocolsAccept webhooks and non-OpenAI payloads through the Invocations protocol.
Control computePick CPU and memory for each session's sandbox.
Stateful by designFiles and state persist across turns in $HOME and /files.
Long-running work PreviewResilient execution survives process interruptions and replays streams to reconnecting clients.
Generally availableHosted agents are GA in the current portal; some features (state store, resilience) are preview.

Architecture

CLIENTS App / OpenAI SDKResponses Teams & CopilotActivity Webhooks, batchInvocations Voice clientInvocations (WebSocket) Other agentsA2A DEDICATED ENDPOINT Responses Invocations Invocations (WebSocket) Activity A2A v1.0 · v0.3 Microsoft Entra IDno API keys AGENT SERVICE · PLATFORM-OWNED Container imagepulled from Azure Container Registry Agent versionsimmutable snapshot; serves 100% Agent identityown Entra ID, created at deploy Conversations · state storedurable, independent of compute Scaling · lifecycleper session, scale to zeroobservability injected PER-SESSION VM-ISOLATED SANDBOX · YOUR CODE Your agent codeAgent Framework · LangGraph · customPython · C# $HOME and /filespersisted across idle periods Compute per session0.5 vCPU / 1 GiB · 1 vCPU / 2 GiB · 2 vCPU / 4 GiBidle timeout 2 to 240 min (default 15)up to 20 GiB disk at 1 vCPU or more CALLS, USING THE AGENT IDENTITY Foundry models Toolbox (MCP) Your Azureservices App Insightstraces You own what runs inside the sandbox.The platform owns the endpoint, identity, scaling,session state and observability around it.

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

1 GiB

Light agents, simple tool orchestration.

1 vCPU

2 GiB

A balanced starting point.

2 vCPU

4 GiB

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, $HOME and other writable paths.

Compute follows the session, not the request. Click a state, or let it play.

Active

Compute is running and requests are routed to it. $HOME and /files are available. Every request resets the idle timer.

Idle

No requests for the idle timeout (2 to 240 minutes, default 15). The platform deprovisions compute and persists session state.

Resumed

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.
ScenarioProtocolWhy
Chatbot or assistant; multi-turn Q&A with RAG or toolsResponsesPlatform manages history, streaming and session lifecycle; any OpenAI-compatible SDK works.
Background or async processingResponsesbackground: true with platform-managed polling and cancellation.
Published to Teams or Microsoft 365Responses + ActivityThe platform bridges Responses to Activity for channel delivery.
Webhooks (GitHub, Stripe, Jira); classification, extraction, batchInvocationsArbitrary JSON in and out; you cannot change the sender's payload.
Custom streaming (for example AG-UI)InvocationsRaw SSE control.
Real-time voiceInvocations (WebSocket)Bidirectional streaming; pair with Pipecat, LiveKit or Voice Live.
Agent-to-agent delegationA2Av1.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
IdentityScopePurpose
Agent identity (Entra ID)Per agent, created at deployWhat the container authenticates with at run time: models, tools, downstream Azure services.
Project managed identityProject-wide, system-assignedPlatform 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.
  1. Write the agentUse Microsoft Agent Framework, LangGraph or your own code, with a protocol library that serves HTTP or WebSocket, health checks and OpenTelemetry.
  2. Package and pushBuild a container image and push it to Azure Container Registry.
  3. Create a versionWith the Azure Developer CLI (azure.ai.agent service in azure.yaml) or the Foundry SDK: image, CPU and memory, environment variables and protocols. Each call creates an immutable version.
  4. Call the endpointLive as soon as it deploys; publishing is only for Teams and Microsoft 365.
  5. ObserveAn Application Insights connection string is injected automatically. Traces appear under Investigate › Transaction search.
  6. 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 agentHosted agent
Defined byInstructions, model, toolsYour container image
You managePrompts and configurationCode, image, dependencies
FrameworksManaged by FoundryAny (Agent Framework, LangGraph, Semantic Kernel, custom)
Compute controlNone neededCPU and memory per session
Custom protocolsPlatform protocolsInvocations, WebSocket, Activity, A2A
Pick it whenInstructions and tools are enoughYou need your own logic, dependencies or protocols
14 · Know what you pay for

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.

Foundry has no page of its own in the Azure pricing calculator because it is composed of several optional services. Add each service you use (for example Azure AI Search, Speech or Language) and compare your estimate with Cost Management meters after a small test.

Where the money goes

Model inferencePer token for standard, priority, flex and batch; per PTU per hour for provisioned.
Fine-tuningTraining (per token or hour), hosting per hour even when idle, and inference per 1,000 tokens.
Hosted agentsCPU and memory during active sessions.
Partner modelsMarketplace; Claude is billed in CCU (next section).
Knowledge and storageAzure AI Search, Storage and Cosmos DB, especially with standard agent setup.
Safety and toolsContent Safety and Foundry Tools such as Speech, Vision and Language.
ObservabilityApplication Insights and Log Analytics follow their own retention and billing.
AI GatewayThe Azure API Management instance behind it.

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).

ONE REQUEST · CONTEXT WINDOW BUDGET Instructions Tool defs History Retrieved context User Reasoning Output input tokens (cached input is cheaper and does not use PTU capacity) generated tokens Input, reasoning and output share the budgetMore input leaves fewer tokens for generation.Max output tokens is a cap, not a reservation. Short vs long context pricingSome models price by input length of the request,not by their maximum context window. Quota and limitsTPM and RPM per model, deployment and region.Exceeding them returns HTTP 429.

Estimate a month of tokens

You supply the rates. The numbers below are placeholders to show the math, not real prices. Enter the per-million-token rates for your model and deployment type from the Azure OpenAI pricing page (or your partner offer).
Tokens per month0
Estimated monthly cost (30 days)
$0
inputcached inputoutput
Cache hit +20 points saves$0
20% shorter output saves$0

Compare the deployment options

OptionBillingLatency SLABest for
Standard (Global, Data Zone, regional)Pay per tokenNoneDevelopment, test and production with variable or unpredictable traffic.
Priority processingPay per token at the priority rateDefined target per modelLatency-sensitive production without a long commitment.
Provisioned (PTU)Per PTU per hour, or Azure ReservationsDefined target per modelMission-critical, high-scale production needing guaranteed throughput.
BatchDiscounted batch rate (50%)None; 24-hour turnaroundBulk, asynchronous work.
Flex processing PreviewDiscounted token ratesNoneDelay-tolerant workloads.
DeveloperPay per tokenNoneFine-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.

Model-independentThe same PTU quota can deploy any supported model. You do not buy PTUs per model.
Region-specificQuota is per subscription, per region and per deployment type. East US quota does not carry to West Europe.
Throughput varies by modelA heavier model needs more PTUs for the same TPM. Each model has a minimum PTU count.

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:

  1. Request shapeRequests per minute, average input tokens and average output tokens.
  2. 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.
  3. 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 spilloverDeploymentName on the provisioned deployment to a standard deployment of the same model and version in the same resource.
  • Per request: send the x-ms-spillover-deployment header. If spillover occurs, the response carries x-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

Right-size the modelUse model router in Cost mode, or the smallest model that passes your evaluation.
Cache what repeatsStable prefixes and prompt caching cut input cost; at the gateway, semantic caching can avoid whole calls.
Trim tokensShorter instructions, fewer tool definitions (tool search), tighter retrieval, and output limits.
Use batch and flexMove anything that can wait off the real-time path.
Cap with limitsPer-project TPM and token quotas through the AI Gateway.
Measure by meterCost Management: group by resource then meter; budgets and alerts after one full billing cycle.
15 · Claude consumption units

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.

Tokensinput · outputby model Price in dollarsAnthropic per-modeltoken rates DiscountMarketplaceprivate offer ÷ CCU pricefixed, on theMarketplace offer CCU on your invoicehourly meteringmonthly in arrears · MACC Every lever that reduces tokens, or moves them to cheaper token classes, reduces CCU.
TopicDetail
Billing unitClaude Consumption Unit, used for invoicing all Claude models in Foundry.
CCU priceFixed; published on the Claude offer on Azure Marketplace. Denominated in USD.
ConversionToken usage is priced at Anthropic's per-model rates (the rate at the time of each call), discounts applied, then converted to CCU.
CadenceMetered hourly, invoiced monthly in arrears. Pay as you go: no prepaid CCU credits.
MACCCCU spend is MACC-eligible and decrements your Azure Consumption Commitment like other Marketplace consumption.
DiscountsApplied at the token-to-CCU step through Azure Marketplace private offers; per-model rates are possible. Not a separate invoice line.
ScopeNew Claude deployments bill in CCU. Earlier deployments keep their existing per-model plan; create a new deployment to move.
SubscribeFrom 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.

Enter your own numbers. Rates and the CCU price are placeholders. Use Anthropic's published per-model rates, your private-offer discount, and the CCU price on the Marketplace offer. The method follows the docs: tokens × rate, apply discount, divide by CCU price.
Baseline0 CCU
After optimization0 CCU
You save
0
Dollar view$0

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.
SurfaceWhat you see
Azure Cost ManagementActual billed usage and cost, aggregated under the single CCU meter (not split by model).
Foundry portal › Pricing tabDiscover › Models › a Claude model › Pricing, linking to Claude pricing.
Foundry portal › Monitor tabPer-model token usage and request counts. For CCU deployments, an estimated cost chart.
Marketplace private offerYour contracted pricing, reflected in billed CCU.
Foundry's estimates do not reflect private-offer discounts, so they can differ from billed cost. Treat Cost Management and your invoice as the source of truth.
Safety note for Claude. Foundry does not apply built-in content filtering to Claude at deployment time. Configure Azure AI Content Safety during inference, and review how data is processed and retained for Claude under Anthropic's terms.
16 · See what agents actually did

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?"

Observabilityone data model TraceOpenTelemetry → Application Insights Monitortokens, latency, success rate Evaluatecontinuous evals, red-team scans Optimizetraces → datasets → better agent Alert and governanomalies, policy, compliance

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.

What is capturedUser inputs and agent outputs, tool calls and results, token consumption, duration and latency.
StatusTracing is GA for prompt and hosted agents. Workflow and external agents are in preview.
Where it livesAzure Monitor Application Insights; view in the Foundry portal (Operate › Tracing) or in Azure Monitor.
Replay and annotateReplay agent traces; annotate with human feedback; log end-user feedback.
Traces to datasetsConvert traces into evaluation datasets to test against real behavior.
Protect sensitive contentRestrict access to sensitive content in traces; Entra authentication for trace ingestion.

Build › Agents › your agent › Monitor tab Preview. Summary cards on top, charts below, for the selected time range.

MetricRead it as
Token usageHigh usage can mean verbose prompts or responses worth optimizing.
LatencyAbove about 10 seconds can indicate model throttling, complex tool calls or network issues.
Run success rateBelow about 95% warrants investigating failed runs.
Evaluation metricsScores from evaluators on sampled outputs; interpretation varies by evaluator.
Red teaming resultsOutcomes 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.

Recurring evaluations PreviewRun evaluations on a schedule against benchmarks.
Red team scans PreviewScheduled adversarial tests for data leakage and prohibited actions.
Alerts PreviewLatency, token usage, evaluation scores and red-team findings.

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.

PaneUse it to
OverviewSee fleet health, cost trends, run completion rate and prevented behaviors; drill into anomalies.
AssetsSearch 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.
ComplianceDefine, apply and monitor guardrail policies (next sections).
TracingInspect runs across projects.
QuotaSee 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.

  1. Connect Application Insights to the projectTracing and the Monitor dashboard read from it.
  2. Grant accessLog Analytics Reader (and Privileged Monitoring Data Reader if tables are protected).
  3. InstrumentPrompt and hosted agents emit traces by default; for your own code use OpenTelemetry with the Foundry SDK, or framework integrations.
  4. Open Operate › Tracing and the agent's Monitor tabVerify spans, tokens and latency.
  5. Turn on continuous evaluation and alertsUse the gear icon in Monitor settings.
17 · Measure before and after you ship

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.

What to evaluatedataset · generatedsimulated · production traces Unitsingle turn, orcomplete conversation Evaluatorsquality · RAG · agentsafety · similarityrubric · custom Scoresmetrics +explanations GateCI/CD orrecurring

The built-in evaluator catalog

EvaluatorMeasures
CoherenceLogical consistency and flow of responses.
FluencyNatural language quality and readability.
EvaluatorMeasures
RetrievalHow effectively the system retrieves relevant information.
Document RetrievalRetrieval accuracy given ground truth.
GroundednessHow grounded the response is in retrieved context (1 to 5, model-based).
Groundedness Pro PreviewPass or fail via Azure AI Content Safety; needs no model deployment.
RelevanceHow relevant the response is to the query.
Response Completeness PreviewWhether the response misses critical information versus ground truth.
EvaluatorMeasures
Task Adherence PreviewWhether the agent follows through on identified tasks per system instructions.
Task Completion PreviewWhether the agent completed the requested task end to end.
Intent Resolution PreviewHow accurately the agent identifies and addresses user intent.
Customer Satisfaction PreviewHelpfulness, completeness, clarity, tone, resolution and adaptability across a conversation.
Task Navigation EfficiencyWhether the agent's sequence of steps matches an optimal or expected path.
Tool Call Accuracy · Tool Selection · Tool Input AccuracyQuality of tool calls, choice of the most appropriate tool, and strict correctness of parameters.
Tool Output Utilization · Tool Call SuccessWhether tool outputs are used correctly, and whether calls ran without technical failures.
Quality Grader · Output Quality · Tool Use Quality PreviewBatched judges that score several dimensions in one call instead of running each evaluator separately.
EvaluatorDetects
Hate and unfairness · Sexual · Violence · Self-harmHarmful content categories.
Protected materialsUnauthorized copyrighted or protected content.
Indirect attack (XPIA)Falling for an indirect jailbreak injected through retrieved context.
Code vulnerabilitySecurity issues in generated code.
Ungrounded attributesFabricated information inferred from interactions.
Prohibited actions · Sensitive data leakageAgent 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

PortalBuild › Evaluations. Pick data and evaluators; view results and analyze clusters of failures.
SDK (cloud evaluation)Evaluate individual turns or complete conversations, generate and evaluate synthetic conversations, fetch results.
CI/CDRun evaluations in GitHub Actions or Azure DevOps and fail the build below your thresholds.
ContinuousRecurring evaluation of sampled production traffic from the Monitor tab.
Benchmarks and human reviewBenchmark evaluations across models; set up human evaluation.
DatasetsBring your own, generate a synthetic dataset, or convert agent traces into one.

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.
Make it a habit. Establish a baseline score first, so every later change (a new prompt, model, tool or knowledge source) is measured rather than anecdotal. Then wire the same dataset into the optimizer and your CI pipeline.
18 · Safety at run time

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.

Userprompt Agentmodel + instructions ToolAPI, MCP, search Userfinal answer 1 2 3 4 User inputjailbreak, harm Tool call · previewharmful args, data sent Tool response · previewindirect injection Outputprotected material, harm

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.

RiskModelsAgents Preview
Hate · Sexual · Self-harm · ViolenceYesYes
User prompt attacks (jailbreak)YesYes
Indirect attacks (XPIA)YesYes
Protected material for text and codeYesYes
Personally identifiable information PreviewYesYes
Task adherence PreviewYesYes
Spotlighting PreviewYesNo
Groundedness detection PreviewYesNo

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
OffNothing (may still annotate). Off for inputs is available to all; off for outputs needs approval for modified guardrails.
LowHigh-severity only. Least restrictive.
MediumMedium and high severity.
HighLow, 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.
Claude has no built-in deployment-time filtering in Foundry. Configure Azure AI Content Safety during inference for Claude and other partner models.
  1. Open Build › Guardrails (or Operate › Compliance)You need the Foundry Account Owner role.
  2. 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.
  3. 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.
  4. Test, then evaluateProbe with the AI Red Teaming Agent and run safety evaluators.
  5. Enforce fleet-wideUse guardrail policies (Azure Policy) to mandate minimum controls across a subscription or resource group (governance section).
Block listsCustom terms to always block, via Azure AI Content Safety.
Custom categoriesTrain your own categories to detect organization-specific content.
Content streamingControl how filtering works while a response streams.
Safety system messagesTemplates and guidance to steer model behavior; pair with filters.
Third-party integrationsBring other guardrail providers into the flow.
Hosted agent egress controls PreviewLimit which outbound destinations a hosted agent can reach, in the same guardrail.
19 · Control at scale

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.

Fleet control · Foundry Control Planeinventory · health · compliance · quota · AI Gateway · custom agent registry Guardrails · Defender for Cloud · Microsoft Purviewcontent safety · threat protection and posture · auditing, classification, DSPM for AI Azure Policybuilt-in and custom definitions · allowed models · guardrail policies · required tags Network and data protectionprivate link · managed virtual network · network security perimeter · customer-managed keys · Key Vault Identity and accessMicrosoft Entra ID · Foundry roles · agent identity and blueprints · endpoint authorization · user delegation Every layer applies to models, agents and tools alike

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.

TabOutcome
PoliciesReview guardrail policies, check compliance, create or edit enforcement rules. Select a non-compliant policy, pick an asset, then Fix now.
AssetsInspect model deployments, see policy violations, jump to remediation.
GuardrailsCompare guardrail configurations across deployments and spot coverage gaps.
Security postureDefender 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.

Foundry guardrailsContent filters, prompt shields and abuse detection at the model layer.
Defender for CloudPosture recommendations for misconfigurations and threat protection that detects jailbreak and user input attacks. Needs Security Admin or Owner to enable.
Microsoft PurviewAuditing, sensitive information type classification and DSPM for AI over prompt and response data. Needs Foundry Account Owner to configure; data security policies require Entra user-context tokens.

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.
20 · Token governance

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.

Project A agentsown TPM and quota Project B agentsown TPM and quota Custom agentsregistered, governed MCP clientstool traffic AI GATEWAY · AZURE API MANAGEMENT (v2 TIERS) Token limit (TPM, 429) · token quota (hour…year, 403) Token metrics → Application Insights Semantic caching (Azure Managed Redis) Load balancing · circuit breaker across backends MCP and agent governance · auth · IP filtering Logging: tokens, prompts, completionsApiManagementGatewayLogs → Log Analytics Provisioned (PTU)priority backend: guaranteed throughput Standard (pay as you go)overflow and secondary backend Other endpointspartner models, your own models, MCP servers

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

TierRole in Foundry AI Gateway (per the docs)
Basic v2What the portal creates when you choose Create new. Designed for development and testing with SLA support. Typically provisions in 5 to 10 minutes.
Standard v2Recommended for production or higher throughput when you bring an existing instance. For a private Foundry resource, use it with a private endpoint.
Premium v2Production 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 ConsumptionNot 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.
Free tier. AI Gateway includes a free tier for Azure API Management; check API Management pricing for current details and eligibility. The general AI gateway capabilities in APIM apply across tiers, but individual capabilities vary by tier (for example the Anthropic Messages API is currently supported in the v2 tiers). Confirm in the APIM tier comparison before you choose.
  1. 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.
  2. Manage › AI Gateway › Add AI GatewayPick the Foundry resource.
  3. 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.
  4. Name it and AddWait until the status is Enabled.
  5. Add projectsNew projects in the resource have the gateway enabled by default. Existing projects need Add project to gateway.
You enable the gateway per Foundry resource; all its projects share it and its APIM instance, each with its own limits. For separate gateways (strict isolation or different networking), use separate Foundry resources.

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.
CapabilityHow APIM does it
Token rate limiting and quotasllm-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 metricsllm-emit-token-metric policy: emit consumption with custom dimensions to Application Insights and Azure Monitor.
Semantic cachingllm-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 balancingBackend pool with round-robin, weighted, priority-based or session-aware balancing, for example prioritizing PTU backends.
Circuit breakerStops sending to unresponsive backends; trip duration follows the backend's Retry-After header.
LoggingLog tokens, prompts and completions for billing and audit; built-in dashboard in APIM.
ScaleAutomatic or manual scale units and regional gateways, depending on tier.
Developer experienceSelf-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>
  1. Check metricsAzure portal › your APIM › Monitoring › Metrics › Requests. Make a test call and watch the count rise.
  2. Turn on logsDiagnostic settings › Logs related to ApiManagement Gateway › Log Analytics, resource-specific tables.
  3. QueryApiManagementGatewayLogs | where TimeGenerated > ago(1h). Look for 200 responses with your API name.
  4. Test limitsExceed the TPM limit (429) and the quota (403) on purpose.
SymptomLikely cause
Gateway not listed after creationStill provisioning; wait a few minutes (Basic v2 is typically 5 to 10).
Project shows Disabled; requests bypassExisting projects are not auto-enabled; add the project to the gateway.
Existing APIM not in the listNot a v2 tier, different tenant or subscription, or missing permissions.
Permission error creating the gatewayMissing Contributor/Owner or API Management Service Contributor.
21 · Keep going

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.

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 --check before 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/… (older ai-foundry links redirect here).