Microsoft has published a comprehensive guide on deploying existing agentic services to Microsoft 365 Copilot through a gateway architecture with On-Behalf-Of token flows, enabling organizations to leverage their custom AI investments without complete rewrites.
Microsoft has released detailed guidance for organizations seeking to integrate existing agentic services with Microsoft 365 Copilot without rebuilding them from scratch. This approach addresses a critical challenge for enterprises that have invested in custom AI solutions using frameworks like LangChain, Semantic Kernel, or proprietary implementations.
What Changed: New Integration Path for M365 Copilot
Microsoft's new documentation introduces a gateway architecture that bridges M365 Copilot with existing agentic services. This approach allows organizations to maintain control over their orchestration logic, framework choices, session management, and downstream service authentication while surfacing these capabilities within the Microsoft 365 ecosystem.
The key innovation is the separation of concerns into two independently deployable services:
- M365 Gateway: A stateless service handling Bot Framework protocol, channel authentication, and the first On-Behalf-Of token exchange
- Agentic Service: A stateful service containing business logic, service-token validation, and downstream OBO flows
This architecture stands in contrast to Microsoft's previously recommended approach of rebuilding agents using M365 Copilot Agents (either declarative or custom engine).
Provider Comparison: Microsoft's Approach vs. Alternatives
Microsoft's solution presents several advantages over other approaches to integrating AI services with productivity platforms:
Microsoft 365 Copilot Gateway Approach
Pros:
- Maintains existing framework investments and custom logic
- Provides complete control over orchestration and tool calling
- Supports user-delegated access to downstream services via chained OBO flows
- Enables independent scaling of gateway and service components
- Framework-agnostic implementation
Cons:
- Requires additional infrastructure (gateway component)
- Involves complex token flow management
- Needs careful security configuration for OBO flows
Alternative: Native M365 Copilot Agents
Pros:
- Tighter integration with Microsoft ecosystem
- Simpler configuration for basic scenarios
- Microsoft support and maintenance
Cons:
- Limited control over orchestration logic
- Framework constraints
- Potential vendor lock-in
- Less flexibility for complex custom implementations
Competitor Approaches (Google Workspace, AWS, etc.)
Other cloud providers offer similar AI integration capabilities but with different trade-offs:
- Google Workspace: Offers integration through Vertex AI and Dialogflow, with less emphasis on preserving existing agent architectures
- AWS: Provides Amazon Bedrock with agent capabilities, but requires more significant refactoring for existing services
- Salesforce: Einstein Platform offers agent integration but within its specific ecosystem constraints
Microsoft's approach appears most favorable for organizations with substantial existing AI investments that wish to maintain flexibility while gaining Microsoft 365 integration.
Business Impact: Strategic Considerations
Organizations evaluating this integration approach should consider several business and technical factors:
Migration Complexity and Cost
The gateway approach significantly reduces migration costs compared to complete rewrites. According to Microsoft's documentation, organizations can bring existing agentic services to M365 Copilot by writing only the gateway layer while keeping the core service intact. This preserves existing investments in development, testing, and domain-specific logic.
The deployment sequence involves:
- Creating service and bot app registrations in Entra ID
- Granting admin consent for delegated permission chains
- Configuring Azure Bot OAuth connections
- Deploying services to Azure Container Apps
- Building and uploading the M365 app package
Security and Compliance Implications
The architecture implements a defense-in-depth security model with multiple validation points:
- Gateway channel validation for Bot/token traffic
- Service bearer validation at the API boundary
- ContextVar isolation for per-request assertion handling
- Session owner isolation using validated claims
- Downstream data access controls
Organizations with strict compliance requirements will appreciate the explicit token validation and the ability to maintain control over security boundaries.
Operational Considerations
The independently scalable components allow for optimized resource allocation:
- Gateway services can scale horizontally to handle many concurrent conversations
- Agentic services can be sized based on computational requirements rather than conversation volume
- Session management can be implemented with various storage backends (in-memory for MVP, Redis or Cosmos DB for production)
Developer Experience and Ecosystem Impact
This approach enables organizations to:
- Maintain preferred development frameworks and tools
- Preserve existing prompt engineering and tool calling investments
- Continue using chosen LLM providers while gaining Microsoft 365 integration
- Leverage Microsoft's authentication and authorization infrastructure
The documentation specifically mentions support for multiple frameworks including Microsoft Agent Framework, LangChain, LangGraph, Semantic Kernel, and custom implementations, indicating Microsoft's commitment to flexibility.
Implementation Recommendations
For organizations considering this approach, the following recommendations emerge from the technical documentation:
Start with a Proof of Concept: Implement the gateway pattern for a single, non-critical agentic service to validate the approach before scaling.
Invest in Security Configuration: The OBO token flows require careful configuration of Entra ID app registrations, OAuth connections, and JWT validation. Microsoft provides a detailed security checklist that should be followed rigorously.
Plan for Session Management: While the documentation includes an in-memory session store for MVP, production deployments should consider persistent storage options like Redis or Cosmos DB.
Consider Developer Onboarding: The gateway pattern adds complexity to the integration. Ensure development teams understand the token flow and API adaptation requirements.
Establish Monitoring: The architecture includes multiple components that require monitoring, particularly token exchange success rates, gateway-to-service communication, and downstream API calls.
Microsoft's documentation includes a reference implementation at james-tn/dbx-mcp-copilot that demonstrates the complete architecture in practice.
Conclusion
Microsoft's new guidance for integrating existing agentic services with M365 Copilot through a gateway architecture represents a significant strategic option for organizations with substantial AI investments. This approach balances the benefits of Microsoft 365 integration with the preservation of existing technical investments and operational flexibility.
The solution appears particularly valuable for enterprises that:
- Have made significant investments in custom AI implementations
- Require fine-grained control over orchestration and tool calling
- Need user-delegated access to downstream systems
- Operate in regulated environments with strict compliance requirements
As organizations continue to navigate the evolving AI landscape, this approach offers a pragmatic path to productivity platform integration without sacrificing technical autonomy or incurring excessive migration costs.

Comments
Please log in or register to join the discussion