Deploying scalable agents

From microsoft/ai-agents-for-beginners · View interactive version

Deploying scalable agents is an AI agent skill from the GitHub repository microsoft/ai-agents-for-beginners. 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 Open

How to use this skill

Skill file

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:

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

CODE0:

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 CODE0

with the catalog in CODE0. 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

Guardrails for the assistant


<!-- CO-OP TRANSLATOR DISCLAIMER START -->

Disclaimer:

This document has been translated using AI translation service Co-op Translator. While we strive for accuracy, please be aware that automated translations may contain errors or inaccuracies. The original document in its native language should be considered the authoritative source. For critical information, professional human translation is recommended. We are not liable for any misunderstandings or misinterpretations arising from the use of this translation.

<!-- CO-OP TRANSLATOR DISCLAIMER END -->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.