Integrate Your Existing Agent Into Microsoft Teams Without Rebuilding
Deploy Any Bot to Teams Using a Single HTTP Adapter
If you've already constructed an agent—whether it's a LangChain implementation, an Azure AI Foundry deployment, or a Slack-based bot—you can connect it to Microsoft Teams without starting from scratch. Since Teams is where most enterprise collaboration occurs, bringing your existing agent into that environment represents significant value before investing in Teams-specific development.
The solution leverages a straightforward pattern within the Teams TypeScript SDK: the HTTP server adapter. This adapter connects to your current HTTP server, automatically registers a messaging endpoint, and allows your existing infrastructure to continue operating unchanged. Three common scenarios illustrate this approach: migrating a Slack bot, connecting a LangChain chain, and bridging an Azure AI Foundry agent.
How the SDK Handles the Details
Beyond the basic connection, the SDK manages critical security and routing tasks: it validates that each incoming request originates from Teams before executing your handler and automatically directs messages to appropriate event handlers.
The Core Pattern
Every implementation follows an identical three-step approach:
Wrap your server with an adapter, initialize the Teams app with that adapter, then define a message handler that invokes your agent.
The SDK injects a POST endpoint at /api/messages into your existing Express server. This endpoint represents the standard interface through which Teams delivers messages to your bot. Your server remains under your control; the Teams SDK simply adds this single route.
Three Implementation Scenarios
Scenario 1: Existing Slack Bot
Teams and Slack users can now share a single bot. Rather than maintaining separate codebases, both platforms operate within the same Express process. The Slack Bolt framework uses ExpressReceiver to mount onto an Express app without owning the entire server, and the Teams SDK follows the same pattern. Slack messages arrive at /slack/events while Teams messages arrive at /api/messages, with shared business logic accessible to both handlers.
Scenario 2: LangChain Integration
Existing LangChain chains can be exposed to Teams users with minimal modification. Your chain definition remains untouched. A thin bridge layer forwards Teams messages to your chain, invokes the language model, and returns the response. The implementation includes a typing indicator to signal that processing is underway.
Scenario 3: Azure AI Foundry Agent
For agents deployed in Azure AI Foundry, the Teams SDK receives incoming messages and forwards them to the Foundry service. A new thread is created for each conversation, the user message is submitted, the agent run is executed, and the assistant's response is extracted and relayed back to Teams.
Getting Started: Registration and Deployment
All three scenarios follow an identical registration process:
- Step 1: Obtain a public HTTPS URL for your server. For local development, Dev Tunnels (integrated into VS Code and the Azure CLI) or ngrok can provide this.
- Step 2: Register your bot using the Teams SDK CLI, which automates Azure Active Directory app registration, secret generation, manifest creation, and bot configuration.
- Step 3: Sideload the application into your Teams client for testing by following the CLI output instructions.
Python Support
The same three-step pattern is available through a Python SDK that works with FastAPI and other ASGI frameworks, offering equivalent functionality to the TypeScript implementation.
The Consistent Principle
Every scenario demonstrates the same underlying philosophy: your server remains yours. The adapter functions as the connection point between your existing infrastructure and Teams. Whether you deploy Express, FastAPI, or another HTTP server, the SDK doesn't prescribe the underlying technology—it only requires the ability to register a route and handle requests.
If you're already operating a bot elsewhere, integrating it with Teams requires only a few lines of adapter code.