On this page

๐ŸŽ“ Workshop Overview

A progressive 7-exercise workshop for building AI agents and multi-agent workflows with Microsoft Agent Framework in Python. From creating your first agent to designing multi-agent pipelines with streaming events โ€” all powered by Microsoft Foundry.

How to Use This Workshop

  1. Complete the Setup โ€” Install prerequisites, configure Dev Container, set up Azure credentials
  2. Click an exercise in the sidebar (or the curriculum table below)
  3. Open your terminal alongside this site โ€” each exercise tells you exactly what to code
  4. Use the ๐Ÿ“‹ Walkthrough links for conceptual guidance without seeing the full solution
  5. Track your progress with the sidebar progress bar

[!TIP] Each exercise has a starter.py with # TODO: markers. Fill in the blanks, then run check.sh to validate. Reference solutions are in src/demo*.py if you get stuck.


Skill Progression

Exercise 1   Exercise 2    Exercise 3     Exercise 4      Exercise 5       Exercise 6      Exercise 7
Run Agent โ†’ Web Search โ†’ MCP Tool โ†’ Struct Output โ†’ Multi-Agent โ†’ DevUI โ†’ Capstone
    โญ          โญ          โญโญ          โญโญ          โญโญโญ        โญโญโญ       โญโญโญโญ
 create      add hosted   MCP stdio     Pydantic       workflow       visual       design your
 & run       web search   tool via      + response_    edges +        debugger     own agent
 agent       tool         npx           format         streaming      + API
Phase Exercises Scaffolding Level What you do
๐ŸŸข Foundations 1, 2 High โ€” fill-in-the-blank Complete TODO markers in mostly-written code
๐ŸŸก Integration 3, 4 Medium โ€” guided Implement key functions with hints and references
๐ŸŸ  Orchestration 5, 6 Low โ€” goal-oriented Build toward a described outcome with minimal starter code
๐Ÿ”ด Capstone 7 None โ€” from scratch Design and implement your own agent end-to-end

Curriculum

# Title Key Concepts Difficulty Time
Setup Setup & Installation Dev Container, Azure CLI, environment variables โ€” 15-30 min
1 Run Your First Agent FoundryChatClient, .as_agent(), run(), async lifecycle โญ 15-20 min
2 Web Search Tool client.get_web_search_tool, Bing grounding, tool integration โญ 20-30 min
3 MCP Stdio Tool Model Context Protocol, MCPStdioTool, local tool servers โญโญ 20-30 min
4 Structured Output response_format, Pydantic BaseModel, output parsing โญโญ 20-25 min
5 Multi-Agent Workflow Workflow orchestration, agent edges, streaming events โญโญโญ 30-40 min
6 DevUI DevUI server, entity discovery, OpenAI-compatible API โญโญโญ 25-35 min
7 Capstone Project All prior concepts โ€” build your own agent or workflow โญโญโญโญ 45+ min

Total: 7 exercises across 4 phases โ€” estimated ~5 hours


What is Microsoft Agent Framework?

Microsoft Agent Framework is a Python SDK for building AI agents backed by Microsoft Foundry. It provides a structured way to create agents that can use tools, produce structured output, and orchestrate multi-agent workflows โ€” all with streaming support and a visual debugging UI.

Key Features

  • ๐Ÿค– Agent Creation โ€” FoundryChatClient โ†’ .as_agent() โ†’ run() lifecycle
  • ๐Ÿ” Tool Integration โ€” Hosted tools (Web Search) and local tools (MCP stdio)
  • ๐Ÿ“Š Structured Output โ€” Pydantic models with response_format parameter
  • ๐Ÿ”„ Workflow Orchestration โ€” Multi-agent pipelines with WorkflowBuilder and edges
  • ๐Ÿ“บ DevUI โ€” Visual debugger with OpenAI-compatible API endpoint
  • ๐Ÿ” Azure-native โ€” Entra ID authentication, Foundry project integration

Quick Start

# 1. Clone and open in Dev Container / Codespaces
git clone https://github.com/shinyay/getting-started-with-agent-framework.git
cd getting-started-with-agent-framework
# Open in VS Code โ†’ "Reopen in Container"

# 2. Configure environment
cp .env.example .env
# Edit .env with your Microsoft Foundry values

# 3. Authenticate
az login --use-device-code

# 4. Verify setup โ€” run Exercise 1's solution
python src/demo1_run_agent.py

For detailed setup, see the Setup & Installation page.


Exercise Structure

Each exercise directory (workshop/exercises/ex<N>_*/) contains:

File Purpose
README.md Objectives, concepts, step-by-step instructions
starter.py Skeleton code with # TODO: markers
check.sh Validation script to verify your solution

Solutions are in src/demo*.py. Detailed walkthroughs are available as ๐Ÿ“‹ links in the sidebar.


Requirements

  • Azure subscription with AI Foundry project access
  • Python 3.10+ (3.11+ recommended)
  • Azure CLI installed and authenticated
  • Node.js / npx (for MCP exercises)
  • VS Code with Dev Container support (recommended)

โš ๏ธ Version note: This workshop targets Agent Framework 1.2.2 (April 29, 2026 stable). Online documentation may describe a newer version with API differences. When in doubt, trust the code in this repository.

๐Ÿ‘‰ Start the Setup โ†’