Share via

Bot Authentication Issue

Dhruvi Kapatel 0 Reputation points
2025-08-20T11:32:23.3433333+00:00

We have a Node.js Bot Framework bot hosted on Azure App Service (Linux) and connected to an Azure Bot resource for Web Chat. The error indicates our token request is being directed to the “Bot Framework” directory instead of our tenant, despite providing TenantId and setting MicrosoftAppType=SingleTenant.

Repro steps

  1. Open Azure Bot - Test in Web Chat.

Send any message (e.g., “hello”).

The bot logs onTurnError with AADSTS700016 and no reply appears in Web Chat.

Observed error (UTC timestamps) 2025-08-20T10:30:56Z user message: hello 2025-08-20T10:30:56Z Bot Reply (local processing): “Hi there! Ask me anything.” 2025-08-20T10:30:56Z Adapter error: “AADSTS700016: Application with identifier ‘717c2fdc-7edb-41eb-bdbd-6a392a378f37’ was not found in the directory ‘Bot Framework’. You may have sent your authentication request to the wrong tenant.” Trace ID: 1074c62a-6a1c-46a7-952c-958511ae2e00 Correlation ID: 97ce1902-cd81-4c0a-ae41-3cade4e96965

Environment

  • Subscription: Azure subscription 1 / 6c42e21c-3aff-41a6-afcb-a0b6803572fa

Region: Central India

  • Azure Bot resource:
Azure AI Search
Azure AI Search

An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.


1 answer

Sort by: Most helpful
  1. Nikhil Jha (Accenture International Limited) 4,335 Reputation points Microsoft External Staff Moderator
    2025-09-29T20:24:06.8+00:00

    Hello Dhruvi Kapatel,

    AADSTS700016: Application with identifier '717c2fdc-7edb-41eb-bdbd-6a392a378f37' was not found in the directory 'Bot Framework'. You may have sent your authentication request to the wrong tenant.

    This typically occurs when the Azure Bot resource is not properly linked to the App Registration in your own tenant, and the token request is falling back to the default Bot Framework tenant instead.

    This error happens because the bot’s AppId is not correctly resolved within your tenant, causing it to try authenticating against the Bot Framework tenant instead. Double-check your App Registration, Bot resource configuration, and App Service environment variables to ensure all IDs and secrets align with your tenant.

    For reference:
    https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-authentication?view=azure-bot-service-4.0&tabs=userassigned%2Caadv2%2Ccsharp
    https://learn.microsoft.com/en-us/azure/bot-service/bot-service-manage-overview?view=azure-bot-service-4.0&tabs=userassigned

    Threads with similar issue and resolved:
    https://learn.microsoft.com/en-us/answers/questions/5491634/aadsts700016-application-with-identifier-x-was-not
    https://learn.microsoft.com/en-us/answers/questions/2046326/aadsts700016-application-with-identifier-(id)-was
    https://stackoverflow.com/questions/57324634/aadsts700016-application-with-identifier-some-id-was-not-found-in-the-directo


    If it helps, please accept the answer and vote to make it useful to other members of the community.

    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.