Skip to content
Skillpedia
Agents79k Β· #1724

deploying-scalable-agents

What it does

This skill guides the move of an AI agent from a prototype to a production deployment. It is for teams who want their agent to run reliably, be monitored, and be tested before each release.

When to use it

  • βœ“When you want to deploy a working agent to Microsoft Foundry as a hosted, versioned service.
  • βœ“When you need approval steps, caching, or evaluation checks before a new agent version goes live.
  • βœ“When you want to add tracing and monitoring to an agent running in production.

Skill link

https://github.com/microsoft/ai-agents-for-beginners/blob/main/.agents/skills/deploying-scalable-agents/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/microsoft/ai-agents-for-beginners/blob/main/.agents/skills/deploying-scalable-agents/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œHelp me take my agent prototype and deploy it to Microsoft Foundry with monitoring.”

5 new skills a week. 1 minute to read.

How it works

The agent reviews your prototype and suggests a deployment pattern. It then adds parts such as model routing, approval steps, monitoring, and smoke tests after deployment.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Deploying Scalable Agents with Microsoft Foundry

Companion skill for Lesson 16 – Deploying Scalable Agents. Use it to help a learner move an agent from prototype to a scalable, observable production deployment. Ground every recommendation in the lesson content and the runnable notebook; do not invent Foundry APIs.

Triggers

Activate this skill when a learner wants to:

  • Deploy an agent to Microsoft Foundry as a hosted agent and make it versioned/observable.
  • Choose between client-hosted, hosted-agent, and agent-workflow deployment patterns.
  • Add model routing, response caching, or bounded concurrency to control latency and cost.
  • Add an evaluation gate so a bad agent version cannot ship.
  • Add a human-in-the-loop approval step for high-risk actions.
  • Instrument an agent with OpenTelemetry tracing for production observability.
  • Smoke-test a deployed agent as a fast post-deploy gate.

Core mental model

A production agent is mostly the operational skeleton around the model (~80%), not the model itself. Map every recommendation to one of these concerns:

Concern Prototype β†’ Production
Hosting notebook β†’ versioned hosted service
Identity your az login β†’ managed identity + scoped RBAC
State in-memory β†’ externalised thread/memory store
Failure traceback β†’ retries, fallbacks, alerts
Cost "a few cents" β†’ tracked, routed, cached, budgeted
Quality eyeballing β†’ automated evaluation gate
Trust you approve β†’ policy + human-in-the-loop

Deployment patterns (pick one, or combine)

  1. Client-hosted β€” the reasoning loop runs in your process. Max control; you own scaling/state.
  2. Hosted agent (Foundry Agent Service) β€” Foundry hosts the loop, stores threads, enforces RBAC/content safety, shows the agent in the portal. Less control, far less operational surface.
  3. Agent workflow β€” multiple agents/tools composed into a graph with branching, approval nodes, and durable checkpoints.

Lifecycle (the loop that ships an agent)

create β†’ version β†’ evaluate (gate) β†’ deploy hosted β†’ observe online β†’ collect failures β†’ repeat. Offline evaluation is a gate, not an afterthought β€” a version does not ship unless it clears the threshold. Online observability feeds real failures back into the offline test set.

Scaling and cost levers (in priority order)

  1. Right-size the model β€” use the smallest model that passes the evaluation gate.
  2. Route by complexity β€” small/fast model for simple requests, large model for real reasoning (DIY classifier or Foundry Model Router).
  3. Cache β€” serve near-duplicate requests without a model call.
  4. Stateless design + bounded concurrency β€” externalise state; retry with backoff.

Key patterns to reproduce

Point the learner at these from the notebook 16-python-agent-framework.ipynb:

  • Request handler: cache β†’ route by complexity β†’ trace span β†’ run β†’ cache.
  • Evaluation gate: score an offline test set; return pass_rate >= threshold and only deploy if true.
  • Human approval: @tool(approval_mode="always_require") for actions like large refunds.
  • Tracing: wrap each request in tracer.start_as_current_span(...) and set attributes like routed.model, customer.id.

Smoke-testing a deployed agent

After deploy, verify the endpoint actually answers (a green deploy can still be silent). Use the AI Smoke Test action via .github/workflows/smoke-test.yml with the catalog in tests/. The runner POSTs each prompt to POST {project_endpoint}/agents/{agent_name}/endpoint/protocols/openai/responses and asserts on the reply text. The identity needs the Azure AI User role at Foundry project scope; the token audience must be https://ai.azure.com/.

Layer the gates: smoke test (reachable/responding, every deploy) β†’ offline evaluation (good enough to ship, before promotion) β†’ online evaluation (how is it doing in the wild, continuous).

Enterprise controls

  • RBAC: give each hosted agent a managed identity with least privilege.
  • MCP in production: treat every MCP server as an untrusted boundary β€” pin the version, scope its i
FAQ

What deployment options does it cover?

It covers client-hosted agents, hosted agents, and agent workflows.

How does it help control cost?

It discusses model routing, response caching, and limits on how many requests run at once.

Does it add human approval?

Yes. It covers an approval step for high-risk actions.

Details

Original description by the author

Take a working agent prototype to a scalable, observable production deployment on Microsoft Foundry. Covers deployment patterns (client-hosted, hosted agents, agent workflows), the agent lifecycle, model routing, response caching, evaluation gates, human-in-the-loop approval, observability with OpenTelemetry, cost optimisation, and smoke-testing deployed agents with the AI Smoke Test action. Based on Lesson 16 of AI Agents for Beginners. USE FOR: deploy an agent to production, scale an agent, Microsoft Foundry hosted agent, Foundry Agent Service, model routing, response caching, evaluation gat

repo: microsoft/ai-agents-for-beginners

Popularity

GitHub stars
79k
Ranking position
#1724
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills