Bot Framework authentication error: “Application with identifier was not found in the directory ‘Bot Framework’”

Matt Sciaroni 0 Reputation points
2025-12-01T15:31:45.4+00:00

Hello,

I am trying to build a simple Azure Bot (using a Python/FASTAPI + BotBuilder SDK backend) and connect it through the Azure Bot Service using the standard /api/messages endpoint exposed via ngrok.

The bot registration completes successfully, but when I attempt to send a message through Test in Web Chat, the Bot Framework service returns the following error:

pgsql
Copy code
Unauthorized. Invalid AppId passed on token.
AADSTS700016: Application with identifier '{APP-ID}' was not found in the directory 'Bot Framework'.
This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant.
You may have sent your authentication request to the wrong tenant.

The key issue is:

  • The App Registration does exist in my tenant

The Azure Bot resource automatically created the App Registration

My bot code loads the correct App ID and secret

But the Bot Framework service seems to look for my App ID inside its own “Bot Framework” tenant, not in my actual tenant

This results in a token request being sent to the wrong Azure AD tenant

Environment notes:

I am using an Azure for Students subscription

I created a simple “Single Tenant” bot (not multi-tenant)

Authentication consistently fails before my bot receives any activity

I tried multiple new Bot resources and App Registrations, and all behave the same way

My question:

Is this a known limitation when using Azure for Students?

Or does the Bot Framework require a regular commercial Azure tenant for proper AAD trust so that the Bot Framework service can authenticate against the App Registration?

Any guidance on how to resolve this or confirm tenant limitations would be greatly appreciated.

Thank you!

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2025-12-01T15:32:01.4266667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error message you are encountering, AADSTS700016: Application with identifier '{APP-ID}' was not found in the directory 'Bot Framework', typically indicates that the Azure Bot Framework service is unable to locate the App Registration in the expected Azure Active Directory (AAD) tenant. This can happen for a few reasons:

    1. Tenant Mismatch: The Bot Framework service might be looking for the App ID in the wrong tenant. Ensure that the App Registration is indeed created in the same tenant where the Azure Bot resource is registered.
    2. Single Tenant Configuration: Since you mentioned that your bot is configured as a single tenant, ensure that the users trying to access the bot are part of the same tenant where the App Registration exists. If your bot is single-tenant, it will not work for users outside of that tenant.
    3. Azure for Students Subscription: While there are no explicit limitations mentioned regarding the use of Azure for Students subscriptions with the Bot Framework, it is possible that certain features or configurations may behave differently. However, the core functionality should still work as expected if properly configured.
    4. App Registration Issues: Double-check that the App Registration has the necessary permissions and that the API permissions are granted and consented to. Sometimes, even if the registration exists, it may not have the correct permissions set up.

    To resolve this issue, you can:

    • Verify the tenant ID and ensure that your bot and App Registration are in the same tenant.
    • Check the API permissions for the App Registration and ensure that they are correctly set.
    • If possible, try creating a new App Registration and linking it to your bot to see if the issue persists.

    If the problem continues, consider reaching out to Azure support for more specific guidance related to your Azure for Students subscription.

    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.