Agent skill · software engineering · aiskillstore
m365-agents-dotnet
Microsoft 365 Agents SDK for .NET. Build multichannel agents for Teams/M365/Copilot Studio with ASP.NET Core hosting, AgentApplication routing, and MSAL-based auth. Triggers: "Microsoft 365 Agents SDK", "Microsoft.Agents", "AddAgentApplicationOptions", "AgentApplication", "AddAgentAspNetAuthentication", "Copilot Studio client", "IAgentHttpAdapter".
Why this skill is useful
Provides specific implementation patterns and configuration for building Microsoft 365 agents using .NET that the AI wouldn't reliably generate on its own.
What it needs
Requires dotnet installed locally. Requires microsoft account access. About 3k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Microsoft 365 Agents SDK (.NET) Overview Build enterprise agents for Microsoft 365, Teams, and Copilot Studio using the Microsoft.Agents SDK with ASP.NET Core hosting, agent routing, and MSAL-based authentication. Before implementation Use the microsoft-docs MCP to verify the latest APIs for AddAgent, AgentApplication, and authentication options. Confirm package versions in NuGet for the Microsoft.Agents. packages you plan to use. Installation Configuration (appsettings.json) Core Workflow: ASP.NET Core agent host AgentApplication routing Copilot Studio direct-to-engine client DelegatingHandler for token acquisition (interactive flow) Console host with CopilotClient Best Practices 1. Use AgentApplication subclasses to centralize routing and error handling. 2. Use MemoryStorage only for development; use persisted storage in production. 3. Enable TokenValidation in production and require authorization on /api/messages. 4. Keep auth secrets in configuration providers (Key Vault, managed identity, env vars). 5. Reuse HttpClient from IHttpClientFactory and cache MSAL tokens. 6. Prefer async handlers and pass CancellationToken to SDK calls. Reference Files File Contents --- --- references/acceptance-criteria.md Import paths, hosting pipeline, Copilot Studio client patterns, anti-patterns Reference Links Resource URL --- --- Microsoft 365 Agents SDK https://learn.microsoft.com/en-us/microsoft-365/agents-sdk/ AddAgent API https://learn.microsoft.com/en-us/dotnet/api/microsoft.agents.hosting.aspnetcore.servicecollectionextensions.addagent?view=m365-agents-sdk AgentApplication API https://learn.microsoft.com/en-us/dotnet/api/microsoft.agents.builder.app.agentapplication?view=m365-agents-sdk Auth configuration options https://learn.microsoft.com/en-us/microsoft-365/agents-sdk/microsoft-authentication-library-configuration-options Copilot Studio integration https://learn.microsoft.com/en-us/microsoft-365/agents-sdk/integrate-with-mcs GitHub samples https://github.com/microsoft/ …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/m365-agents-dotnet