Bringing Agents into Teams
Key point
How to attach existing agents to Teams using the Teams SDK's HTTP server adapter
Details
With the HTTP server adapter in the Teams TypeScript SDK, you can receive Teams messages by simply adding a POST /api/messages endpoint to an HTTP server that's already running.
The core pattern has three steps.
- Wrap the server: Wrap your existing Express server with
ExpressAdapter. - Create the app: Create a Teams app with
new TeamsApp({ httpServerAdapter }). - Handle messages: Send responses in
teamsApp.on('message', ...).
This structure lets you connect Slack bots, LangChain chains, and Azure AI Foundry agents to Teams without changing your existing infrastructure. The SDK verifies that incoming requests are actually from Teams and routes events to the appropriate handlers.
Three example scenarios are given.
- Slack bot: Coexist
@slack/bolt'sExpressReceiverand the Teams SDK in the same Express process. - LangChain: Feed Teams messages into a chain and send a typing indicator before responding.
- Azure AI Foundry: Pass Teams messages to a Foundry agent thread and return the completed answer back to Teams.
The operational procedure is also laid out.
- Expose the local server to an HTTPS public URL using Dev tunnels or ngrok.
- After
teams login, runteams app create --endpoint .../api/messagesto handle AAD app registration, client secret generation, manifest creation, and bot configuration all at once. - Sideload it into a Teams client to test.
The Python SDK offers the same concept, and it applies the same way in ASGI frameworks like FastAPI. The conclusion is: don't rewrite your existing bot or agent specifically for Teams — just attach a Teams channel with a single adapter.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.