Installation
Environment Variables
Register your bot at Azure Bot Service.
Configuration Options
Setup
- Multi-Tenant (Default)
- Single-Tenant
For apps available to any organization:
Webhook Handler
Features
Supported Events
Message- Regular messages in channels/chatsMessageReaction- Emoji reactions added/removedInvoke(Adaptive Card actions) - Button clicksAction.Submit- Form submissions from Adaptive Cards
Message Types
The adapter handles:- Channel messages - Public/private channel posts
- 1:1 chats - Direct messages with users
- Group chats - Multi-user conversations
- Thread replies - Replies in message threads
Adaptive Cards
Teams uses Adaptive Cards for rich UI:Cards are automatically converted to Adaptive Card format. Text messages support basic markdown.
Reactions
File Attachments
Send files via inline data URIs:Files are sent as data URIs. For large files, consider uploading to external storage and sharing links.
Thread IDs
Teams thread IDs encode conversation ID and service URL:Opening DMs
Create a 1:1 conversation with a user:The user must have interacted with the bot first (via @mention) to cache their
tenantId and serviceUrl.
Without cached values, openDM() will throw a validation error.Message History
Fetch message history from a thread:Platform Limits
- Message length: 28 KB (HTML content)
- Adaptive Card size: 28 KB total
- File size: 4 MB via inline data URI
- Rate limits: Teams throttling thresholds
Thread Context Caching
The adapter automatically caches:- User service URLs (for DM creation)
- Tenant IDs (for Graph API calls)
- Team GUID mappings (for channel message fetching)
Code Examples
Troubleshooting
Bot doesn't respond in channels
Bot doesn't respond in channels
- Install the app to the team via Teams admin center or app store
- @mention the bot first to establish context
- Enable “Receive messages in channels” in app manifest
fetchMessages() not working
fetchMessages() not working
- Add
appTenantIdto adapter config (required for Graph API) - Grant Graph API permissions in Azure AD
- Wait for admin consent if required by your tenant
openDM() throws validation error
openDM() throws validation error
- User must interact with bot first (via @mention) to cache tenantId
- For
SingleTenantapps, provideappTenantIdin config
App Manifest
Your Teams app manifest (manifest.json) should include:
Next Steps
Message Handling
Process messages and build conversation flows
Adaptive Cards
Create interactive UIs with Adaptive Cards
Bot Framework
Learn more about Azure Bot Service
State Management
Persist data across requests