What I'm trying to do
Get my Python-based Teams bot (using microsoft-teams-apps 2.0.11, single-tenant, deployed on Azure Container Apps) to receive activities from Microsoft Teams again. Web Chat works perfectly; Teams stopped delivering and won't resume.
Setup
- Azure Bot resource configured as single-tenant,
msaAppType=SingleTenant, msaAppTenantId=<tenant>, messaging endpoint set to my Container App's /api/messages.
- AAD app
signInAudience=AzureADMyOrg, service principal accountEnabled=true.
- Bot endpoint reachable from public internet (returns 200 on
/health, 401 on unauthenticated POST /api/messages, as expected).
- Org-published Teams app (custom LOB) — status Unblocked in Manage apps. Third-party apps + Custom apps allowed org-wide. Permission policy assigned to the user allows the app.
- App is installed, visible under "Built for your org", chat opens, input box is enabled.
What's working
- Test in Web Chat from the Azure Bot resource: activity arrives at the bot endpoint, my backend is called, bot replies in webchat. Container logs show
POST /api/messages 200 OK with webchat.botframework.com relay URLs.
What's failing
- Microsoft Teams: I send a message in Teams, no
POST /api/messages ever arrives at the container (verified with live az containerapp logs show). No new entries appear on Bot resource → Channels → Microsoft Teams either — Microsoft is neither delivering nor reporting failures.
What I think happened
Earlier today the bot was returning HTTP 500 on conversationUpdate and other system activities. The cause was an upstream SDK bug: microsoft-teams-apps 2.0.11 raises pydantic.ValidationError on activities whose entities[] contain newer types the SDK doesn't recognize:
-
ClientCapabilities
-
ProductInfo
-
QuotedReply
-
TargetedMessageInfo
Repro of the SDK error from container logs:
ERROR microsoft_teams.apps.http.http_server: 14 validation errors for tagged-union[...]
typing.entities.0.ClientInfoEntity.type
Input should be 'clientInfo' [type=literal_error, input_value='ClientCapabilities', input_type=str]
... (similar errors for MentionEntity, MessageEntity, AIMessageEntity, StreamInfoEntity,
CitationEntity, SensitiveUsageEntity, ProductInfoEntity, QuotedReplyEntity,
TargetedMessageInfoEntity)
INFO: POST /api/messages HTTP/1.1" 500 Internal Server Error
The Bot resource's Channels page logged these as InternalServerError events for hours.
What I've done to mitigate
- Upgraded
microsoft-teams-apps from 2.0.0a20 to stable 2.0.11. Did not help — the missing entity types are absent from 2.0.11 too.
- Deployed a FastAPI middleware that returns
200 {"status": "acknowledged"} whenever /api/messages would have returned 500 due to the SDK ValidationError. Verified working: container logs now show POST /api/messages 200 OK on every activity, and the Bot resource Channels page has no new error entries since the workaround was deployed (about 2h ago).
- Removed and re-added the Microsoft Teams channel on the Bot resource.
The actual problem now
Even though the bot is healthy and returning 200 to everything, Microsoft Teams is not attempting to deliver any activities to the bot endpoint. It's been about 2 hours since the mitigation went live, and Teams is silent — no successful delivery, no failure entry either.
My hypothesis: Microsoft's Teams channel routing put this bot in an exponential-backoff state due to the earlier 500s. Even with the bot now healthy, the backoff hasn't expired and won't until Microsoft's routing service re-tests the endpoint.
Questions
- Does Microsoft's Bot Framework Teams channel apply per-bot exponential backoff on 5xx responses, and if so, what does the cool-off window look like? I can't find anywhere this is documented.
- Is there a way to force Teams' channel routing to re-test the bot endpoint sooner, short of opening a paid support case? I already tried removing and re-adding the Teams channel on the Bot resource — didn't change anything.
- Is filing the SDK bug at https://github.com/microsoft/teams.py the right place for the underlying
ValidationError issue, or is there a more appropriate channel for Bot Framework Python SDK schema issues?
- For anyone else who has hit this: did
az bot msteams delete + az bot msteams create work as a recovery? Did you have to rotate the AAD app / Bot resource entirely? How long did Microsoft's automatic backoff take to expire in your case?
Any guidance appreciated.Even though the bot is healthy and returning 200 to everything, Microsoft Teams is not attempting to deliver any activities to the bot endpoint. It's been about 2 hours since the mitigation went live, and Teams is silent — no successful delivery, no failure entry either.
My hypothesis: Microsoft's Teams channel routing put this bot in an exponential-backoff state due to the earlier 500s. Even with the bot now healthy, the backoff hasn't expired and won't until Microsoft's routing service re-tests the endpoint.
Questions
- Does Microsoft's Bot Framework Teams channel apply per-bot exponential backoff on 5xx responses, and if so, what does the cool-off window look like? I can't find anywhere this is documented.
- Is there a way to force Teams' channel routing to re-test the bot endpoint sooner, short of opening a paid support case? I already tried removing and re-adding the Teams channel on the Bot resource — didn't change anything.
- Is filing the SDK bug at https://github.com/microsoft/teams.py the right place for the underlying
ValidationError issue, or is there a more appropriate channel for Bot Framework Python SDK schema issues?
- For anyone else who has hit this: did
az bot msteams delete + az bot msteams create work as a recovery? Did you have to rotate the AAD app / Bot resource entirely? How long did Microsoft's automatic backoff take to expire in your case?
Any guidance appreciated.Even though the bot is healthy and returning 200 to everything, Microsoft Teams is not attempting to deliver any activities to the bot endpoint. It's been about 2 hours since the mitigation went live, and Teams is silent — no successful delivery, no failure entry either.
My hypothesis: Microsoft's Teams channel routing put this bot in an exponential-backoff state due to the earlier 500s. Even with the bot now healthy, the backoff hasn't expired and won't until Microsoft's routing service re-tests the endpoint.
Questions
- Does Microsoft's Bot Framework Teams channel apply per-bot exponential backoff on 5xx responses, and if so, what does the cool-off window look like? I can't find anywhere this is documented.
- Is there a way to force Teams' channel routing to re-test the bot endpoint sooner, without opening a paid support case? I already tried removing and re-adding the Teams channel on the Bot resource — didn't change anything.
- For anyone else who has hit this: did
az bot msteams delete + az bot msteams create work as a recovery? Did you have to rotate the AAD app / Bot resource entirely? How long did Microsoft's automatic backoff take to expire in your case?
Any guidance appreciated.