Microsoft Teams Azure Bot Not Receiving Messages Despite Correct Configuration

Jose Vera 0 Reputation points
2024-11-26T16:45:06.7866667+00:00

I am experiencing an intermittent issue where our Microsoft Teams bot does not receive messages from the Teams client. Despite the bot being fully functional in Direct Line and Web Chat channels, the Teams integration fails to send requests to our bot's messaging endpoint.

This issue has occurred multiple times across different bot resources, and while recreating the Azure Bot resource and app registrations temporarily resolves the problem, it reoccurs shortly after. Notably, I have two bots (one for production and one for development) with identical configurations and source code; however, only one of them currently works in Teams, while the other does not.

Error Details:

  1. Teams Client Logs:
    • No registered active worker for user ID
      • TimeoutRunningApp with previousStep: RenderStarted
      1. Azure Bot Logs:
        • Our bot application does not show any logs indicating that Teams is attempting to send requests to the bot's /api/messages endpoint when the issue occurs.
        1. Manifest and Configuration:
          • The Teams app manifest has been validated and is configured correctly, including the bot ID, valid domains, and endpoint.
            • The Azure Bot Service messaging endpoint is set to the correct URL and works in other channels.

Troubleshooting Steps Taken:

  1. Verified Configuration:
    • Confirmed that the bot's App ID, secret, and tenant ID are correctly configured in Azure and match the Teams manifest.
      • Validated the Teams app manifest and ensured it aligns with the bot registration.
      1. Endpoint Testing:
        • Confirmed that the /api/messages endpoint is live and responds as expected.
          • The bot works flawlessly in Direct Line and Web Chat, but Teams does not send any requests to the bot.
  2. Recreated Resources:
  • Deleted and recreated the Azure Bot resource, app registrations, and Teams app. This temporarily resolved the issue, but it reoccurred for one of the bots.
  • Deleting the Teams channel and re-registering it does not fix the issue.
    • I also tried creating a new Teams app package, but the issue persisted.
  1. Testing Across Framework Versions:
    • I attempted using both the TypeScript and Python versions of the Bot Framework SDK. The issue occurs with both implementations, which indicates it may not be related to the bot's source code.
  2. Similar Issues Reported by Others:
    • I found reports on Microsoft forums of other developers facing the same issue. Many were able to resolve it by recreating all resources (bot registrations, Teams app packages, etc.) from scratch. However, this solution is not sustainable as the issue tends to reoccur after some time.
    1. Network and Health Checks:
      • Verified network connectivity and ensured no firewall, VNET, or NSG rules are blocking Teams traffic.
        • The /health endpoint responds with HTTP 200 as expected.

Request for Help:

  1. Why does the Teams client not send messages to the bot endpoint despite correct configuration?
  2. Are there any known issues with Teams caching bot configurations or intermittently losing connectivity with the Azure Bot Service?
  3. Can someone help investigate the "No registered active worker" error and "TimeoutRunningApp" in Teams logs? I would appreciate any guidance or advice on resolving this issue. Thank you!
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,457 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,401 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.