// PART 07
Microsoft Teams
Microsoft Teams delivers messages as Bot Framework activities: the platform
posts each activity to /api/msteams/messages, the bot resolves the
conversation, routes it through the normal pipeline and answers with an
activity posted back to the service URL.
Configuration
The adapter reads six keys through ConfigManager::get_config
(botmsteams/src/adapter.rs, botmsteams/src/auth/mod.rs). Two of them are
sensitive — the client secret and the outgoing-webhook token — so they live in
the bot’s Vault path; the Drive monitor drops sensitive keys from config.csv,
which is only the home of the non-sensitive four.
| Key | Required | Where | Purpose |
|---|---|---|---|
teams-app-id |
yes | config.csv |
Azure Bot registration (Microsoft App ID); also the aud every inbound Bot Framework token must carry |
teams-app-password |
yes | Vault | Client secret for that registration |
teams-tenant-id |
no | config.csv |
Single-tenant registrations; empty for multi-tenant |
teams-bot-id |
no | config.csv |
Bot identity as Teams sees it; defaults to teams-app-id |
teams-service-url |
no | config.csv |
Bot Framework endpoint; defaults to https://smba.trafficmanager.net (TeamsAdapter::new) |
teams-security-token |
no | Vault | Base64 security token of an outgoing webhook; only needed for that integration |
name,value
teams-app-id,00000000-0000-0000-0000-000000000000
teams-tenant-id,<tenant-guid>
When teams-app-id or teams-app-password is absent the adapter refuses to
send (Teams adapter not configured) and reports it in the log rather than
posting an unauthenticated call.
Register the bot in Azure
The bot needs an Azure Bot registration that points back at this server. These
steps are Microsoft’s, not General Bots’; the only deployment-specific value is
the messaging endpoint — it must be the public URL that reaches
POST /api/msteams/messages on the botserver behind your proxy.
Inbound auth
Teams authenticates itself with a Bot Framework JWT in
Authorization: Bearer; the adapter validates it against the app id
(teams-app-id is the expected aud). The outgoing-webhook integration is
the alternative: a shared base64 token in teams-security-token verified as
an HMAC. There is no anonymous path for this route — unlike the
verify-token-only channels, a request carrying neither credential is rejected.
What the adapter supports
| Capability | Status |
|---|---|
| Inbound text activities | ✅ |
| Conversation resolution (tenant, conversation id) | ✅ |
| Outbound activities to the service URL | ✅ |
| Suggestions / rich cards | ❌ (same buffered plain-text reply model as the other channels) |
| Streaming | ❌ |
Troubleshooting
| Symptom | Check |
|---|---|
| No activity arrives | messaging endpoint reachable from Teams? proxy passes POST /api/msteams/messages? |
| 401 on inbound | JWT aud ≠ teams-app-id, or tenant mismatch for single-tenant registrations |
| Nothing sent back | look for Teams adapter not configured in the log — app id or Vault secret missing |
| Outgoing webhook events dropped | teams-security-token absent from Vault or wrong base64 value |