Bot Service "Test in Web Chat" fails with 401, but backend is public and receives no logs.

António Costa 0 Pontos de reputação
2026-05-26T17:33:31.0133333+00:00

Hello, community and Microsoft engineers.

I've been struggling for days with a Bot Service authentication issue and would appreciate your expertise.

The Setup:

  • Backend: A Python FastAPI app hosted on Google Cloud Run. The endpoint is https://teams-alfred-bridge-1046601765278.us-central1.run.app/api/messages.

Azure: A Bot Service (Conselho-IAs-V2) and an App Registration (63923d24-...).

The Problem: When I use the "Test in Web Chat" feature in the Azure Portal, it fails with HTTP status code Unauthorized.

What I've verified (This is why I'm stuck):

The Google Cloud Run endpoint is 100% public (allows unauthenticated invocations) and is healthy.

When I test, absolutely no logs (no requests, no errors) appear on my Google Cloud Run service. This proves the request is never leaving the Azure ecosystem.

I have regenerated the Client Secret multiple times, copied it perfectly, and synced it to my backend's environment variables. The MICROSOFT_APP_ID and MICROSOFT_APP_PASSWORD are correct.

My Python code uses the official botbuilder-core SDK with the correct authentication settings.

My Question: Since my backend is never reached, the 401 Unauthorized error seems to be generated internally by the Azure Bot Service test harness. Could this be an issue with my App Registration's tenant configuration (e.g., Single-tenant vs. Multi-tenant)? Or is there a known bug with the "Test in Web Chat" feature that would prevent it from calling an external endpoint even if the credentials are correct?

Thank you for any insights!Hello, community and Microsoft engineers.

I've been struggling for days with a Bot Service authentication issue and would appreciate your expertise.

The Setup:

Backend: A Python FastAPI app hosted on Google Cloud Run. The endpoint is https://teams-alfred-bridge-1046601765278.us-central1.run.app/api/messages.

Azure: A Bot Service (Conselho-IAs-V2) and an App Registration (63923d24-...).

The Problem:
When I use the "Test in Web Chat" feature in the Azure Portal, it fails with HTTP status code Unauthorized.

What I've verified (This is why I'm stuck):

The Google Cloud Run endpoint is 100% public (allows unauthenticated invocations) and is healthy.

When I test, absolutely no logs (no requests, no errors) appear on my Google Cloud Run service. This proves the request is never leaving the Azure ecosystem.

I have regenerated the Client Secret multiple times, copied it perfectly, and synced it to my backend's environment variables. The MICROSOFT_APP_ID and MICROSOFT_APP_PASSWORD are correct.

My Python code uses the official botbuilder-core SDK with the correct authentication settings.

My Question:
Since my backend is never reached, the 401 Unauthorized error seems to be generated internally by the Azure Bot Service test harness. Could this be an issue with my App Registration's tenant configuration (e.g., Single-tenant vs. Multi-tenant)? Or is there a known bug with the "Test in Web Chat" feature that would prevent it from calling an external endpoint even if the credentials are correct?

Thank you for any insights!

Serviço de Bot da IA do Azure

2 respostas

Classificar por: Mais Antigo
  1. António Costa 0 Pontos de reputação
    2026-05-26T18:29:47.69+00:00

    Hello Karnam,

    Thank you for the quick follow-up.

    While you investigate, I want to add a crucial piece of information that confirms this is a structural authentication issue on the Azure/Bot Framework side, and not just a bug with the "Test in Web Chat" tool.

    Update: I have successfully packaged the bot using the Developer Portal and deployed it to our Microsoft Teams Admin Center. The App was approved and installed in our Teams client.

    However, the exact same behavior occurs in the Teams channel:

    We send a message to the bot in Microsoft Teams.

    The bot stays completely silent (no response).

    Most importantly: Zero logs (no incoming requests, no errors) are generated in our Google Cloud Run backend. The message never reaches our endpoint.

    This confirms that the Azure Bot Service pipeline is dropping/rejecting the outbound request for both Web Chat and Teams channels before it ever leaves the Microsoft ecosystem, likely due to a silent validation error with our App Registration/Tenant configuration.

    Please let me know if you need our App ID or Tenant ID to check the backend logs.

    Thank you!

    Esta resposta foi útil?

    0 comentários Sem comentários

  2. António Costa 0 Pontos de reputação
    2026-05-27T17:57:03.3866667+00:00

    Subject: RE: Missing "Multi-Tenant" option during Azure Bot Creation causing 401 Unauthorized

    Hello,

    Thank you for reaching out. Let me clarify the exact roadblock we are facing, which requires your engineering assistance.

    The Current Situation: Our bot's backend (hosted on Google Cloud Run) is perfectly healthy, public, and processing requests. However, when we use the "Test in Web Chat" feature in Azure, the request is blocked internally by the Bot Framework validation layer, returning a 401 Unauthorized.

    The Root Cause (And what we need help with): As per your own documentation and previous support suggestions, we need to create our "Azure Bot" resource as a Multi-Tenant application to properly authenticate with Microsoft Teams.

    However, the "Multi-Tenant" option is completely missing/hidden from the "Type of App" dropdown in our Azure Portal UI when we try to create a new Azure Bot resource (we only see "Single Tenant" or "User-Assigned Managed Identity").

    Because we are forced into a "Single Tenant" configuration by the UI, the Bot Framework SDK in our Python backend rejects the tokens generated by Microsoft Teams/Web Chat.

    Our Questions for you:

    Why is the "Multi-Tenant" option missing from our Azure Bot creation blade? Is there a specific Entra ID / Tenant policy blocking this for our organization (adboutique.com.br)?

    We have already created a Multi-Tenant App Registration manually (3c459b96-8900-450a-91ff-6450283b5bd8). How can we force the Azure Bot resource to bind to this existing Multi-Tenant App ID if the UI refuses to let us select it?

    We appreciate your swift resolution on unlocking this UI restriction so we can proceed.Azure Bot 30 Multitenant absence.png

    Esta resposta foi útil?

    0 comentários Sem comentários

Sua resposta

As respostas podem ser marcadas como ‘Aceitas’ pelo autor da pergunta e ‘Recomendadas’ pelos moderadores, o que ajuda os usuários a saber a resposta que resolveu o problema do autor.