Concept 16 of 16 · 10 min read

Governance, resilience, optimization, and publishing

Govern agents and tools at scale, design for resilience, optimize agent quality, and publish agents to Microsoft Teams and Copilot.

Hello, I am Alex, your Article Narrator. I can walk you through this article, so you can follow it with me in narration.

Govern your agent fleet from one place

Foundry Control Plane is the unified management view in the Microsoft Foundry portal for agents, models, and tools across your subscription. It answers a problem that shows up once you move past a single demo agent: each project has its own settings, but compliance and cost questions span the whole organization.

Concept 15 covered guardrails, encryption, and network isolation for one project. This concept is about running many agents in production—seeing fleet health, enforcing organization-wide rules, surviving outages, improving quality with the agent optimizer, and publishing agents where people already work. Use Control Plane when you manage agents across teams or platforms, need centralized compliance visibility, integrate Microsoft Defender and Microsoft Purview signals, or track token usage and cost across the environment. Without it, you jump between separate project views and Azure portal blades.

  • Inventory and health: active agents, run completion, cost trends, and alerts in one subscription-wide view.
  • Performance and risk: tie together evaluation results, traces, and red-teaming to find quality or safety regressions.
  • Compliance and security: define guardrail policies, apply bulk fixes, and see Defender and Purview alerts on the dashboard.
  • Prerequisite called out in the docs: connect an AI gateway on the Foundry resource when you want advanced governance features for tools.

Operate and Manage in the portal

You reach fleet features from the Microsoft Foundry portal. Select Operate on the upper-right toolbar to monitor, govern, and optimize agents, models, and deployments across the subscription. Select Manage for settings tied to the project you have open—quota, AI Gateway, users, connected resources, and parent resource details. Operate is subscription-wide; Manage follows the project name dropdown in the upper left. Switch projects before you change another team's settings.

Main Operate panes and what each is for
PanePrimary jobTypical actions
OverviewFleet snapshotSee active agents, cost trends, run completion, prevented behaviors, and drill into anomalies
AssetsSearchable inventoryFilter by version, tags, health score, cost, or alerts; open Evaluation or Monitoring for an agent
ComplianceGuardrails at scaleDefine policies, track assignments, monitor posture, and remediate noncompliant assets in bulk
Quota (Manage)Deployment capacityReview quota per model deployment; turn on Show all to see models and regions you have not deployed yet

From Assets you can surface recommendations to refine prompts, upgrade models, or tune configurations from performance and cost signals. Deep links jump you into evaluation and monitoring experiences when you need to debug a specific agent.

Rules for models and for MCP tools

Governance splits by what you are protecting. Model deployments can be constrained with Azure Policy so only approved models and lifecycle states reach production. External tools that speak Model Context Protocol (MCP) can be routed through an AI gateway so authentication, throttling, and logging happen at one front door instead of inside every agent.

Two governance paths
What you governMechanismWhen to use it
Model deployments in FoundryAzure Policy built-in and custom definitionsYou need an allow list of models, lifecycle rules, or subscription-wide enforcement before anyone creates a deployment
New MCP tools in the portal (preview)AI gateway connected to the Foundry resourceYou want one governed entry point with rate limits, IP filters, and audit logs without changing MCP server code
  • In Compliance on Operate, policy work integrates with Azure Policy, Defender, and Purview so identity, data, and threat signals align.
  • For MCP tools (preview): governance applies at the Foundry resource level; only new MCP tools created in the portal that do not use managed OAuth are routed through the gateway.
  • After you add an MCP tool, confirm the tool endpoint shows the AI gateway URL (for example, an azure-api.net/mcp path), not the raw server URL. Policies such as rate limits are applied in Azure API Management in the Azure portal.
  • Gateway routing is applied at tool creation time; older tools are not automatically switched—recreate the tool after the gateway is connected if routing still points at the server directly.

Resilience: what Foundry guarantees and what you own

Resilience means your agents keep working—or recover quickly—when a zone, region, or human mistake takes something offline. Microsoft operates regional platform pieces for Foundry, but the docs state clearly that Foundry does not provide automatic failover or disaster recovery. You and Microsoft share responsibility: Microsoft runs the agent runtime infrastructure in Agent Service, while you own durability for state stores when you use Standard agent deployment mode.

In Basic agent deployment mode, Microsoft manages the data components and your recovery options are limited. In Standard mode, agent state lives in your Azure Cosmos DB, Azure AI Search, and Azure Storage accounts—you configure backup, redundancy, and failover for each. Optional attachments such as Key Vault, Application Insights, and Logic Apps are yours to harden even when Foundry itself does not require them for every workload.

  • Plan separately for platform outages versus accidental deletion of your data stores.
  • Use zone-redundant settings on Cosmos DB, AI Search, and Storage within a region; zone redundancy does not replace a second region.
  • For model inference, Global Standard and Data Zone Standard deployments can route inside their allowed scope, but regional failover still needs application logic or a Generative AI Gateway (often Azure API Management) in front of regional endpoints.
  • Multiregional strategies (hot/hot, hot/warm, hot/cold) trade cost against recovery time and data loss; Foundry projects themselves are created per region by you.

Prevent loss and rebuild after incidents

Prevention beats restore. Apply delete locks on the Foundry account, Cosmos DB account, AI Search service, and Storage account to block resource-level deletion. Locks stop deletion of the whole resource, but they do not stop someone deleting one agent, index, or blob inside it. Pair locks with least-privilege role assignments: in production, avoid standing delete permissions, and prefer that only the project's managed identity has write access to state stores.

Agent deployment mode and recovery
ModeWho holds agent stateRecovery posture
BasicMicrosoft-managed componentsCustomer-managed restore procedures in the resiliency guide do not apply
StandardYour Cosmos DB, AI Search, and StorageYou enable continuous backup on Cosmos DB, rebuild indexes from authoritative sources, and repoint connections after restore
  • Use a user-assigned managed identity on the project so restored resources reattach without reassigning every role; system-assigned identities get new principal IDs when recreated.
  • Define accounts, projects, and dependencies in infrastructure as code (Bicep or Terraform) and export agent JSON definitions on a schedule—Foundry does not sync metadata between primary and secondary projects.
  • Treat Azure AI Search as a derived index, not the only copy of knowledge; thread-attached uploads are generally not recoverable.
  • Enable Cosmos DB continuous backup before an incident; point-in-time restore cannot be turned on retroactively. Pick 7-day, 30-day, or 35-day retention based on your requirements.

Improve agents with the optimizer

The agent optimizer automates the slow loop of edit prompt, run tests, and revise. It evaluates a baseline prompt agent or hosted agent against a dataset, generates candidate configurations (instructions, tool descriptions, skills, or model choices), scores each candidate with your evaluators, and ranks them by a composite score between 0.0 and 1.0. Concept 8 introduced evaluation; here you use those evaluators to drive automated improvements before you publish.

  • Prompt agents: start the optimization wizard from the agent's Optimize tab; pick version, dataset, evaluators, and models; promote the winning candidate to a new version when the run completes.
  • Hosted agents: make the agent optimizer-ready (Foundry Toolkit or Azure Developer CLI), then run optimization against local JSONL or registered datasets; apply the candidate and redeploy.
  • Each evaluator score is rescaled to 0–1, flipped when lower is better, then averaged into the composite score shown in results.
  • Warning in the docs: optimization invokes your agent for every dataset row—external tool calls run for real unless you point at test endpoints or mocks.
How to read composite score deltas
Change vs baselineMeaning
Less than 0.03Likely noise—not worth shipping on score alone
0.03 to 0.10Moderate improvement—consider deploying
0.10 to 0.20Significant improvement
Greater than 0.20Large jump—often signals a weak baseline

Publish where people work, and scale with autopilots

Publishing sends a tested agent to Microsoft Copilot and Microsoft Teams so coworkers discover it in familiar apps. You publish the stable agent endpoint, so users keep the same URL while you change versions behind it. Before publishing, pick the active version on the Details tab (Agent configuration, Edit next to Active version) or in the Publish flow—Always use latest or a pinned version. Updating the version selector rolls out new behavior without republishing to Teams when only the model behavior changes; use Update agent Teams and Microsoft Copilot display properties when name or descriptions change.

Publish scope in the portal
Choice in portalWho discovers the agentAdmin approval
Just youAppears under Your agents for you; share via agent linkNot required
People in your organizationAfter Microsoft 365 admin approval, appears under Built by your org for the tenantRequired

Publishing from the portal is not supported when the project disables public network access; use the REST API path documented for that case. You need permission to create Azure Bot Service resources plus Foundry User on the project. Autopilots extend the story for long-running team or company-wide agents: they add an Entra agent user account so the agent acts as itself in Microsoft 365 (email, calendar, Teams presence). You build a blueprint once; each team hires its own instance with separate permissions. Only hosted agents can be published as autopilot blueprints.

Example, common mistakes, and finishing the arc

Example: Northwind Outfitters runs a returns assistant (Concept 7) in Standard mode. The platform team enables Control Plane Operate views, assigns Azure Policy so only approved chat models deploy, and routes a new GitHub MCP tool through the AI gateway (preview). They lock the Cosmos DB and Search accounts, export agent JSON nightly, and run the optimizer after Concept 14 evaluations pass. They publish to Teams with People in your organization scope after admin approval, pin version 3 until the next optimizer win, and rehearse failover by running a test job in the secondary region each quarter.

  • Assuming Foundry will fail over automatically—plan regions, gateways, and secondary projects yourself.
  • Publishing with Always use latest before a regression-tested version is ready.
  • Skipping AI gateway verification and wondering why MCP traffic bypasses policies (preview).
  • Treating Search indexes as the sole knowledge store—rebuild pipelines will fail in recovery.
  • Running optimizer jobs against production APIs that mutate live customer data.
  • Using Basic deployment mode while expecting Cosmos DB point-in-time restore steps to apply.

You have walked the Foundry arc from first project through architecture, models, agents, tools, observability, evaluation, guardrails, and now fleet governance and production publishing. Keep Operate dashboards, evaluation gates, and recovery drills in the same rhythm as code releases so improvements in the portal actually reach users safely.

Take the Expert level quiz

Test what you learned in the Expert concepts. You need 80% to pass.

Sources for every lesson are listed at the end of Up-Skill with Microsoft Foundry.