What Is Agent Framework?
What Microsoft Agent Framework is, what an agent and a workflow are and when to use each, what happens when an agent calls your C# code, plus the Agent Harness, hosting, models, packages and costs, and where this C# track teaches every concept.
Set Up Your Environment
Get everything ready to build Microsoft Agent Framework agents in C# — the .NET 10 SDK, VS Code with C# Dev Kit or Visual Studio 2026, the Azure CLI signed in, and a Microsoft Foundry project with a model you're allowed to call — with a real check for each.
Your First Agent
Create your first Microsoft Agent Framework agent in C# from a model in a Microsoft Foundry project, run it with RunAsync, read what's in the AgentResponse, and see why a second run doesn't remember the first. Real output from a small travel guide agent.
Streaming
Show a Microsoft Agent Framework agent's answer while the model is still writing it, with RunStreamingAsync in C#. Compare it with RunAsync, time the first words, and put the updates back together with ToAgentResponse to get the token count. Real output from a small science guide.
Instructions, Messages and Run Options
Shape a Microsoft Agent Framework agent's answers in C# three ways. Instructions apply to every run, messages carry what you send in one run, including example answers to copy, and ChatClientAgentRunOptions adds settings to a single run. Real output and token counts from a small vocabulary coach.
Sessions
Keep a conversation going across runs with an AgentSession in Microsoft Agent Framework for C#. Create a session, pass it to every run, see what it holds with Microsoft Foundry, and save it with SerializeSessionAsync so the conversation continues after a restart. Real output from a small cooking helper.
Function Tools
Let a Microsoft Agent Framework agent call your own C# methods. AIFunctionFactory.Create turns a method into a tool with a name, a description and a JSON schema; the model decides when to call it, and Agent Framework runs it and sends back the result. Real output from a small pizza shop, including two calls in one run.