Welcome to this hands-on workshop where you'll learn to build, containerize, and deploy AI agents as hosted agents on Microsoft Foundry Agent Service. You'll use Python and the Microsoft Agent Framework to create production-ready agents that run as managed containerized services with autoscaling, observability, and enterprise-grade security.
By the end of this workshop, you will have:
- Lab 1: A fully functional hosted agent built with Microsoft Agent Framework, tested locally, containerized with Docker, and deployed to Microsoft Foundry Agent Service
- Lab 2: Choose from multiple advanced agent patterns — a Web Search Agent, a RAG Agent, or a Multi-Agent Workflow — and publish your agent to channels
- Understand what hosted agents are and when to use them
- Set up a Microsoft Foundry project with the required resources
- Build an AI agent using the Microsoft Agent Framework (Python)
- Use the hosting adapter to test agents locally
- Containerize your agent with Docker and push to Azure Container Registry
- Deploy your agent to Microsoft Foundry Agent Service
- Manage the agent lifecycle — start, stop, scale, and update
- Monitor agents with OpenTelemetry tracing
- Publish agents to Teams, Web, and API channels
- Basic understanding of Python programming
- Familiarity with REST APIs
- Basic understanding of Docker and containers
- Understanding of basic AI/ML concepts
| Tool | Download Link |
|---|---|
| Python 3.10+ | https://www.python.org/downloads/ |
| VS Code | https://code.visualstudio.com/ |
| Git | https://git-scm.com/downloads |
| Docker Desktop | https://www.docker.com/products/docker-desktop/ |
| Azure CLI | https://learn.microsoft.com/en-us/cli/azure/install-azure-cli |
- Azure subscription (create a free account)
- Microsoft Foundry access (create a project)
This workshop is divided into two progressive labs, each with multiple sub-labs.
💡 Tip: Lab 1 is required before Lab 2. In Lab 2, you choose one (or more) agent patterns to explore.
Duration: 75–100 minutes
| Sub-Lab | Description | Duration |
|---|---|---|
| 1.1 Set Up Azure Resources | Create Foundry project, deploy models, set up ACR | 15–20 min |
| 1.2 Build Your Agent | Build a time-zone agent with Microsoft Agent Framework | 15–20 min |
| 1.3 Test Locally | Use the hosting adapter to test via REST | 10–15 min |
| 1.4 Containerize & Deploy | Docker build, push to ACR, deploy to Foundry | 20–25 min |
| 1.5 Manage & Monitor | Start, stop, scale, and observe your agent | 15–20 min |
Duration: 60–90 minutes (choose your path)
| Sub-Lab | Description | Duration |
|---|---|---|
| 2.1 Web Search Agent | Build an agent that searches the web using Foundry tools | 20–25 min |
| 2.2 RAG Agent | Build a RAG agent with Azure AI Search integration | 20–25 min |
| 2.3 Multi-Agent Workflow | Orchestrate multiple agents in a workflow | 25–30 min |
| 2.4 Publish & Evaluate | Publish to channels and evaluate performance | 15–20 min |
| 2.5 Cleanup Resources | Delete all Azure resources | 5–10 min |
💡 In Lab 2, pick the agent pattern(s) that interest you most — you don't need to complete all three (2.1, 2.2, 2.3).
Hosted agents are containerized agentic AI applications that run on Foundry Agent Service. Unlike prompt-based agents, you build hosted agents through code and deploy them as container images on Microsoft-managed pay-as-you-go infrastructure.
┌────────────────────────────────────────────────────────────────┐
│ Microsoft Foundry │
│ │
│ ┌──────────────┐ ┌──────────────────┐ ┌───────────────┐ │
│ │ Your Agent │ │ Hosting Adapter │ │ Agent Service │ │
│ │ Code (MAF) │───>│ (HTTP Server) │──>│ (Managed) │ │
│ └──────────────┘ └──────────────────┘ └───────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌───────────────┐ │
│ │ Local Tools │ │ Autoscaling │ │
│ │ (Python) │ │ Observability │ │
│ └──────────────┘ │ Conversations │ │
│ └───────────────┘ │
└────────────────────────────────────────────────────────────────┘
| Component | Description |
|---|---|
| Microsoft Agent Framework | Python/.NET SDK for building enterprise AI agents with type safety, checkpointing, and multi-agent orchestration |
| Hosting Adapter | Framework abstraction layer that exposes your agent as an HTTP service for local testing and deployment |
| Agent Service | Managed platform that handles provisioning, autoscaling, state management, identity, and observability |
| Framework | Python | .NET |
|---|---|---|
| Microsoft Agent Framework | ✅ | ✅ |
| LangGraph | ✅ | ❌ |
| Custom code | ✅ | ✅ |
This workshop uses Python with Microsoft Agent Framework.
- Set up your environment — Install all prerequisites
- Start Lab 1 — Build and deploy your first hosted agent
- Continue to Lab 2 — Explore advanced patterns
- Hosted Agents Documentation
- Microsoft Agent Framework
- Foundry Samples — Hosted Agents
- Azure Developer CLI — AI Agent Extension
- Agent Development Lifecycle
- Foundry Pricing
This workshop content is provided for educational purposes.
Ready to begin? Head over to the Setup Guide to get started!