As organizations increasingly adopt Microsoft 365 Copilot to streamline productivity and automate business processes, the ability to build intelligent, enterprise-aware agents becomes a game-changer. One powerful scenario is integrating a custom M365 Copilot agent with an agent built using Azure AI Foundry—combining the flexibility of local development with the enterprise-grade capabilities of Azure-hosted AI.
In this post, we’ll explore how to build such an integrated solution using the Microsoft 365 Agents SDK and Azure AI Foundry, and why this architecture is so valuable.
Why Integrate M365 Agents SDK with Azure AI Foundry?
The Microsoft 365 Agents SDK allows developers to build multi-channel, production-ready agents that run in Teams, Outlook, and Copilot Chat. Azure AI Foundry, on the other hand, provides a scalable platform to build, customize, and manage AI agents with enterprise data and Retrieval-Augmented Generation (RAG) capabilities.
By integrating the two, you can:
- Build and test agents locally using familiar tools.
- Leverage enterprise data and vectorized knowledge from Azure AI Foundry.
- Deploy your agent directly into Microsoft 365 Copilot Chat for seamless user experiences.
- Maintain a clean separation between UI logic and enterprise intelligence.
🌟 Why This Matters for Copilot Chat
Many organizations are standardizing on Microsoft 365 Copilot as the “UI for AI”—a unified, conversational interface where employees can access intelligent assistance across their work apps. By bringing your custom agent into Copilot Chat, you:
- Meet users where they already work—inside Word, Excel, Teams, and Outlook.
- Provide consistent, context-aware answers grounded in enterprise data.
- Enable natural language interactions with your internal systems and knowledge bases.
- Reduce the need for custom front-ends or standalone bots.
This approach empowers employees to get help, complete tasks, and make decisions—all within the familiar Copilot experience. It’s a strategic move toward consolidating AI access and improving adoption across the enterprise.
Check out the Microsoft 365 Agents SDK documentation for more details on building agents that run in Microsoft 365 Copilot Chat.
This scenario is covered in this Microsoft Build 2025 session: Create agents for Microsoft 365 Copilot with Microsoft 365 Agents SDK. In the recording, see the ‘EchoBot’ demo starting at 11:06.
👉 Try It Yourself
To experience this integration firsthand, Microsoft has created a hands-on lab—featured at Microsoft Build 2025: Build25 LAB328 - Build custom engine agents using Microsoft 365 Agents SDK. This lab provides step-by-step instructions across five exercises to guide you through building a custom M365 Copilot agent integrated with Azure AI Foundry.
This lab is designed for developers, cloud solution architects, and IT professionals who want to enhance their Copilot Chat experience with enterprise-aware agents.
What You’ll Build
You’ll create a Contoso HR Agent that:
- Starts as a simple Echo Bot using the M365 Agents SDK.
- Is enhanced with generative AI using Semantic Kernel.
- Connects to an Azure AI Foundry agent for enterprise-aware responses.
- Is deployed into Microsoft Teams and Copilot Chat.
Key Steps in the Lab
Here’s a high-level overview of the lab journey:
1. Prepare Your Agent in Azure AI Foundry
- Log into Azure AI Foundry and open a preconfigured project.
- Customize the agent’s identity and behavior (e.g., Contoso HR Agent).
- Upload HR documents to create a vector store for RAG.
- Test the agent in the Agents Playground using realistic employee queries.
2. Build a Local Agent with M365 Agents SDK
- Scaffold a new agent project using the Echo Bot template.
- Explore the project structure and test the bot locally using the Test Tool.
3. Add Generative AI Capabilities
- Install Semantic Kernel and other packages.
- Add custom classes for document citations and message tracking.
- Enable your agent to reason and respond intelligently.
4. Integrate with Azure AI Foundry
- Connect your local agent to the Azure AI Foundry agent using the Agent ID and connection string.
- Update the
OnMessageAsync
method to stream responses, manage citations, and apply sensitivity labels.
5. Deploy to Copilot Chat
- Update the app manifest to include
copilotAgents
. - Upload the app to Microsoft Teams and test it in Copilot Chat.
- Use conversation starters to validate the agent’s behavior in a real-world scenario.
Conclusion
Integrating Microsoft 365 Agents SDK with Azure AI Foundry represents a powerful approach to building enterprise-aware AI agents that enhance the Microsoft 365 Copilot experience. This architecture allows you to maintain the flexibility of local development while leveraging the scalability and intelligence of Azure’s cloud-based AI services.
By following the hands-on lab, you’ll gain practical experience in building agents that not only understand your enterprise data but also integrate seamlessly into the tools your users already know and trust. This is more than just a technical integration—it’s a strategic move toward creating a unified AI experience that can transform how your organization works.
Ready to get started? The lab is waiting for you, and the future of enterprise AI is just a few steps away.
Links and Resources
- Install Visual Studio 2022 with the .NET desktop development workload.
- Microsoft 365 Agents SDK Documentation
- Install the Microsoft 365 Agents SDK
- Azure AI Foundry Documentation
- Microsoft Build 2025 Session: Create agents for Microsoft 365 Copilot with Microsoft 365 Agents SDK
- Microsoft Build 2025 Hands-on Lab: Build a custom M365 Copilot agent integrated with Azure AI Foundry