Kick off your book project in 3 hours! Live workshop on Zoom. You’ll leave with a real book project, progress on your first chapter, and a clear plan to keep going. Saturday, May 16, 2026. Learn more…

Leanpub Header

Skip to main content

Building Enterprise Agentic AI Systems with Microsoft Agent Framework

This book is 10% completeLast updated on 2026-05-02

Microsoft is selling four ways to build an AI agent, and most teams pick wrong.

This book is the pro-code path through that landscape, end to end.

One customer-support agent grows across the book, from a fifteen-line hello-world to a multi-agent system that surfaces in Microsoft Teams and registers with Microsoft Agent 365.

By the end, you have a working production agent and the mental model to ship more.

Minimum price

$19.00

$29.00

You pay

Author earns

$
PDF
EPUB
WEB
37
Pages
9,852Words
About

About

About the Book

Microsoft is selling four ways to build an AI agent and a fifth product to govern them. Copilot Studio for business users, the Microsoft 365 Agents SDK for in-Microsoft 365 experiences, Foundry Agent Service for managed agents, and Microsoft Agent Framework for pro-code Python and .NET, with Microsoft Agent 365 sitting above all four as the tenant-wide control plane. The names overlap, the messaging blurs, and most teams I have advised end up paying for the wrong choice in wasted weeks. This book is the long answer to "which one, and how."

The book is built for the developer who has decided, or is about to decide, that pro-code is the right answer. After two short orientation chapters that frame the landscape and pin down where Microsoft Foundry fits underneath everything, the rest of the book is hands-on Microsoft Agent Framework, end to end. Every code listing is complete and runnable. Every API is verified against `agent-framework` 1.2.0 by a verification harness that runs on every commit to the companion repository at `github.com/rchaganti/maf-book`. Every chapter advances a single customer-support agent, from "answer a billing question" in chapter 3 to "approve refunds via the order database, escalate to a human, surface in Microsoft Teams, and register with the tenant's Agent 365 control plane" by the closing chapter.

Part I is the orientation. Two chapters that map the four-option landscape, introduce Microsoft Foundry as the platform underneath, and make the case for MAF, with a one-page comparison table and a decision tree the reader can pin somewhere visible.

Part II is the foundations. You install the framework, point it at an Azure OpenAI deployment in a Foundry project, and grow the fifteen-line hello-world from chapter 2 into the customer-support agent with a function tool and a streaming response. You learn the MAF client landscape, `OpenAIChatClient`, `OpenAIResponsesClient`, `FoundryChatClient`, and `FoundryAgent`, and the decision-tree question of which one to use when.

Part III extends the agent. Function tools in depth (with the `@tool` decorator, approval modes, validation), multi-turn conversation through `AgentSession`, structured outputs through `response_format`, and the persistent-agent path that connects directly back to Foundry's managed runtime.

Part IV is tools and context. The Model Context Protocol covered three ways: local MCP servers, Foundry-hosted MCP servers, and exposing your own agent as an MCP server. Agent Skills, the capability layer that complements MCP. Context providers and pluggable memory.

Part V is multi-agent orchestration. Sequential, concurrent, handoff, group-chat, and Magentic patterns, then the workflow primitives underneath them, executors, edges, events, and BSP supersteps, and how to visualize and checkpoint long-running workflows.

Part VI is production. Middleware for redaction, retries, and approvals. Human-in-the-loop function approvals. OpenTelemetry observability that flows into Foundry. The DevUI inspector for local development. Three production hosting paths compared: Azure App Service, Azure Functions, and Foundry-hosted agents.

Part VII is interoperability. Cross-framework communication via the Agent-to-Agent (A2A) protocol. AG-UI for production chat surfaces. The bridge back to Copilot Studio and Microsoft Teams via the M365 Agents SDK and the Microsoft Agent 365 SDK. A migration chapter for teams coming from AutoGen or Semantic Kernel.

By the end of the book, you have a working multi-agent system you can run, a mental model for extending it, and the operational story for taking it to production. Whether you are a Python developer building a customer-support backend, an engineer migrating from AutoGen, or an architect deciding between the four Microsoft authoring paths, the book gives you the pro-code path through the Microsoft enterprise AI landscape, with no rewrites, no fabricated APIs, and no hand-waving over the parts that matter.

Share this book

Author

About the Author

Ravikanth Chaganti

Ravikanth is a Distinguished Engineer and an architect in the AI Solutions Engineering team at Dell Technologies. He is a multi-year recipient of the Microsoft Most Valuable Professional (MVP) award in Azure AI Platform. Ravikanth is the author of Windows PowerShell Desired State Configuration Revealed (Apress) and Pro PowerShell Desired State Configuration (Apress). He self-published several books on Leanpub. He can be seen speaking regularly at local user group events and conferences in India and abroad.

Contents

Table of Contents

Part 1

Microsoft enterprise AI landscape

  1. A stack, not a single product
  2. Copilot Studio
  3. Microsoft 365 Agents SDK
  4. Foundry Agent Service
  5. Microsoft Agent Framework
  6. What actually differentiates the four
  7. Three scenarios, three paths
  8. The comparison, on one page
  9. Why only MAF?

Microsoft Foundry and Agent Framework

  1. A project is the unit of organization
  2. A Foundry project
  3. Foundry from an MAF agent’s point of view
  4. A first look at MAF
  5. What MAF wins, and what it costs

Part 2

Building your first agent

  1. What you will need
  2. Installing MAF
  3. Setting up the deployment
  4. Running the hello-world for real
  5. Giving the agent a job
  6. Adding a function tool
  7. Streaming the response
  8. What you have, what is next

Other books by this author

Other books by this author

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub