Advanced: Use Microsoft 365 Agents Toolkit
Unit 4 of 8 · Module 11: Integrate your agent with Microsoft 365
Go deeper
Unlocks when you've watched the lesson.
Read this lesson
A station in the middle
Most of the time, publishing from the Foundry portal is like a direct train: Teams at one end, your agent at the other, and nothing for you to build. But some large organizations need a stop in the middle. The Microsoft 365 Agents Toolkit is a set of developer tools for Visual Studio Code and Visual Studio that lets you build that stop. It's an advanced option, so feel free to skip it now and come back when you need it. Reach for it when you need your own single sign-on setup, beyond the default Entra ID sign-in. Or when you want middleware: your own code that processes, logs, or reshapes messages on the way through. It also helps when you run separate development, staging, and production environments. And when you want detailed tracing in your own debugger, or deployments through CI CD pipelines in GitHub Actions or Azure DevOps.
How the proxy works
With the toolkit, you build a proxy app, a station between Microsoft 365 and your Foundry agent. A message from Teams or Copilot arrives through Azure Bot Service at your proxy. The proxy runs your middleware, forwards the request to your Foundry agent, and sends the reply back along the same line. You control every step of the journey, but you also have a station to build, deploy, and keep running. To start, install the Microsoft 365 Agents Toolkit extension, select Create a New Agent or App, and choose Custom Engine Agent. The template gives you a standalone agent. You point it at your Foundry agent's endpoint, set up authentication, and add your middleware. Then test it in the Microsoft 365 Agents Playground, a local stand-in for Teams that opens in your browser when you debug. When it works, the toolkit provisions Azure resources, deploys your proxy, and registers it in Teams.
Two routes side by side
So compare the two routes. Direct publishing takes minutes and no code, while the toolkit takes hours or days, plus a proxy app to maintain. Direct publishing offers limited customization, while the toolkit lets you change almost anything. You debug a direct publish from the Foundry portal, but the toolkit gives you full debugging in your editor. Direct publishing covers most standard deployments. Save the toolkit for when you've found a specific need that it solves.
Facts from Microsoft's documentation: Microsoft 365 Agents Toolkit overview; Publish agents to Microsoft Copilot and Microsoft Teams (CC BY 4.0), rewritten in Loop's own words and examples. Narration, animation, and quiz by Loop. Microsoft, Azure, and Microsoft Foundry are trademarks of Microsoft. Loop is independent and not affiliated with or endorsed by Microsoft.