teams app doctor
Run diagnostic checks on a Teams app
Usage
teams app doctor [appId] [options]
Arguments
| Argument | Description | Required |
|---|---|---|
appId | App ID | No |
Options
| Flag | Description |
|---|---|
--json | [OPTIONAL] Output as JSON |
Details
Runs a comprehensive diagnostic check across your app's bot registration, AAD app, manifest, and SSO configuration. Reports pass/fail/warn/info for each check.
Check Categories
Bot Registration
- Bot location detected (Teams-managed or Azure)
- Teams channel is enabled
- Messaging mode reported for both Teams-managed and Azure-managed bots
- Messaging endpoint is reachable when configured (HTTP probe)
AAD App
- AAD app exists and is accessible via Graph
- Client secret expiry status
- Sign-in audience is correct (
AzureADMultipleOrgs)
Manifest
- Bot ID in manifest matches the app's bot ID
- Endpoint domain is listed in
validDomains webApplicationInfoformat is correct (if present)
SSO (only if webApplicationInfo is configured)
- Identifier URI format is
api://botid-{botId} access_as_userscope exists- Teams desktop and web clients are pre-authorized
- Bot Framework redirect URI is present
- OAuth connection
tokenExchangeUrlmatches the identifier URI
Example
teams app doctor <appId>
Socket Mode Diagnostics
Socket-mode bots do not need a messaging endpoint. When socket mode is enabled, the doctor does not warn that an unset endpoint is missing. If an endpoint is still configured, the doctor continues to probe it, even in socket mode.
teams app get <appId> --json
teams app doctor <appId> --json
These commands inspect configuration, not the health of a live socket connection. If messages stop arriving after a mode change, restart your Teams SDK application. A failed mode read is reported as an informational check; use app get --json to distinguish an unknown mode (socketMode: null) from HTTP (socketMode: false).
When to Use
- After
app createto verify everything was set up correctly - After setting up SSO to confirm SSO wiring
- After
app bot migrateto check the new Azure-managed bot - When debugging authentication or token issues