Share via

Technical Summary: 401 Authorization Issue for Multi-Tenant Teams Bot Bot Details: App ID: <yc452ad38-9baf-4aac-b04d-b384efd551c2> Multi-tenant registration: Yes (supports all Azure AD tenants + personal Mic

Abhilash Hota 5 Reputation points
2025-08-16T20:38:51.7066667+00:00

My bot id is the same in my bot server and in registration. Everything looks good from set up. I also able to hit the end messaging end point but no response coming back from teams.

Outgoing messages from Node.js SDK fail with 401:

Incoming messages from Teams are received correctly.

Curl requests to Bot Framework token endpoint succeed.

Error occurs for tenants outside the home tenant.

Azure AI Bot Service
Azure AI Bot Service

An Azure service that provides an integrated environment for bot development.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 42,941 Reputation points MVP Volunteer Moderator
    2025-09-01T20:53:48.5+00:00

    Hello Abhilash !

    Thank you for posting on Microsoft Learn Q&A.

    Your bot is configured as MultiTenant but the runtime is still acting SingleTenant typically because MicrosoftAppTenantId is set (or the authority is hard-coded to your home tenant). In that case the SDK requests a token that isn’t valid outside your tenant, so replies to the Bot Connector get a 401.

    Your app settings should look like this:

    MicrosoftAppType=MultiTenant
    MicrosoftAppId=<your app id>
    MicrosoftAppPassword=<your client secret>
    # IMPORTANT for MultiTenant: DO NOT set MicrosoftAppTenantId
    # Also do not override ChannelService / OAuth Authority for public Azure
    

    Microsoft own guidance for a multitenant bot: leave MicrosoftAppTenantId blank. https://learn.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-registration?view=azure-bot-service-4.0

    Don’t force tokens from https://login.microsoftonline.com/<yourTenantId>/.... For bot-to-connector calls the SDK handles the correct authority and scopes (audience https://api.botframework.com).

    https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-api-reference?view=azure-bot-service-4.0,

    https://moimhossain.com/2025/05/22/azure-bot-service-microsoft-teams-architecture-and-message-flow/

    Was this answer helpful?

    0 comments No comments

Your answer

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