Azure Bot Service empowers developers to build intelligent, enterprise-grade conversational experiences that seamlessly connect users across channels at scale. Each Azure Bot Service has a unique identity Id and type. With MultiTenant Bot creation deprecated as of July 31, 2025, newly created bots are now SingleTenant by default—and if identity configuration is not set up correctly, this can lead to authentication failures such as: “AADSTS700016: Application with identifier 'xxx' was not found in the directory 'Bot Framework'.” In this blog, we’ll break down Bot identity fundamentals, service-to-service authorization, and provide practical migration guidance for transitioning existing MultiTenant bots to the SingleTenant model.
TL;DR
- Every Azure Bot has a fixed identity (MicrosoftAppId) tied to either an App Registration or a Managed Identity—it cannot be changed or reused.
- Azure Bot supports three identity types:
- User-Assigned Managed Identity
- Single-Tenant App Registration
- Multi-Tenant App Registration (deprecated after July 31, 2025)
- Bots involve three auth flows:
- Client → Channel (platform-specific)
- Channel ↔ Bot (core system auth using OAuth2 + Entra ID)
- User sign-in (optional; uses Authorization Code Flow)
- The error “AADSTS700016: Application with identifier 'xxx' was not found in the directory 'Bot Framework'” happens when the Bot application tries to request tokens from the botframework.com tenant instead of its home tenant while the App registration is set as SingleTenant.
- BotFrameworkAdapter Class (Microsoft.Bot.Builder) | Microsoft Learn is hardcoded to the Bot Framework tenant and does not work with Single-Tenant or Managed Identity bots. In Bot-Builder SDK (retires after Dec 2025), CloudAdapter Class (Microsoft.Bot.Builder.Integration.AspNet.Core) | Microsoft Learn supports SingleTenant and UserAssigned-MSI bots and MicrosoftAppType needs to be configured to reflect the correct Bot Identity.
- With announcement of the Bot-Builder SDK deprecation, we recommend moving to The M365 Agents SDK which retains many Bot Builder concepts with ability to create next generation Agents with orchestration, observability and more secure options authentication. This also offers flexible and more secure options for token aquisition.
Skip directly to the "Channel (2) ↔ Bot (3) Authorization" section if you want to understand why the error occurs.
Azure Bot Identity
Every Azure Bot Service has a unique Id (also known as MSAAppId or MicrosoftAppId) which you can find in Azure Portal -> Azure Bot Resource -> Configuration if the Bot is created:
This MSAAppId corresponds to either the Client ID of Application Registration in Microsoft Entra ID or Managed Identity in Azure . This is Id is tied to the respective Bot Service from creation until deletion, cannot be modified or reused for a different Bot resource. Closely related to this is the concept of the Azure Bot Identity Type and can be one of the following:
- User-assigned managed identity - identity tied to a Managed Identity in Azure
- Single-tenant - identity tied to an Application Registration in Microsoft Entra ID with Supported account types = Accounts in this organizational directory only
- Multi-Tenant (Deprecated – ends July 31, 2025) - identity tied to an Application Registration in Microsoft Entra ID with Supported account types = Accounts in any organizational directory
References:
Identity and Authorization
As described in Navigating Azure Bot Networking: Key Considerations for Privatization, an Azure Bot Solution consists of below components:
- Clients (1): User-facing application used to consume/converse with Bot solutions. Examples include Web Chat Widget, Teams, Slack etc.
- The Bot Service: This managed SaaS umbrella includes configuration management, channel services and token services. Services are made available with the <service>.botframework.com endpoints.
- The Bot Application (2): Using the Bot/Agents SDK or Composer, you create an HTTP-based application that encapsulates your functional and conversational logic, including recognition, processing, and storage. The Bot application operates using the Bot Framework Activity Specification. The Bot application exposes a public messaging endpoint for receiving activities (messaging endpoint).
- Channel Connectors (3): While Azure Bot Service provides two native channels—Direct Line and Web Chat—it is designed to be highly extensible and supports integration with additional clients and communication platforms through external channels. These channels are implemented and operated by their respective providers and run within their own managed data centers. The bot’s messaging endpoint is not exposed directly to end users; instead, users interact with the bot via channel connectors, which handle session management, activity routing, and authentication on behalf of the client. Different clients, such as Teams and Slack, represent messages and activities uniquely. Since Bot applications understands and responds with activities as defined in the Bot Framework Activity Specification, channels are responsible for transforming activities and forwarding them to the application.
There are 3 Authentication/Authorization flows in a Bot solution.
- Client (1) to Channel (2) Authentication - This flow is platform-specific and is implemented by the channel owner. It governs how an end-user or client application authenticates with the channel before any interaction reaches the bot. For example, the Direct Line channel requires a token or secret to establish trust, as described in Direct Line Authentication in Azure AI Bot Service - Bot Service | Microsoft Learn
- Channel (2) <-> Bot (3) Authorization - This flow is channel-independent and is consistent across all Azure Bot channels. Communication between the channel and the bot occurs via bi-directional HTTPS calls secured using OAuth2 JWT Access Tokens issued by Microsoft Entra ID. Both the channel and the bot validate each other by exchanging these tokens. This mechanism is what directly relies on the Azure Bot Identity type (Managed Identity, Single-Tenant App, or legacy Multi-Tenant App) and is the primary focus of this blog.
-
User Authentication - This is an optional flow enables end users to authenticate within the chat experience so the bot can identify the user, access protected user data or perform actions on the user’s behalf (e.g., schedule meetings, access emails). User authentication is implemented using the "Authorization Code Flow" and supports multiple identity providers, including Microsoft Entra ID. When Entra ID is used, the bot can authenticate users using the same App Registration as the bot identity, or a separate App Registration, depending on security and design requirements. This user sign-in process is independent of the Channel-to-Bot authorization flow and is not affected by the bot’s identity type.
-
- References:
- Add authentication to a bot in Bot Framework SDK - Bot Service | Microsoft Learn
- Flow Diagram - botframework-sdk - In a brief:
- The Bot application checks whether a user access token already exists in the Azure Bot Token Store.
- If no token is found, the bot challenges the user to sign in within the chat interface. Some channels, such as Microsoft Teams, also support SSO - Enable SSO with Microsoft Entra ID - Teams | Microsoft Learn
- The issued token is then securely stored in the Azure Bot Token Store.
- The user is redirected to the configured Identity Provider (for example, Microsoft Entra ID) and authenticates successfully.
- The Bot application retrieves the token from the Token Store and uses it to access protected resources or perform actions on the user’s behalf.
- References:
Channel (2) <-> Bot (3) Authorization
As we see in the "Outbound Flow: Bot to Channel", the Bot Application typically uses OAuth 2.0 client credentials flow on the Microsoft identity platform - Microsoft identity platform | Microsoft Learn. The token authority (endpoint) used for this flow depends on the Bot Identity Type, as documented in Authenticate requests with the Bot Connector API - Bot Service | Microsoft Learn.
The error "Application with identifier 'xxx' was not found in the directory 'Bot Framework'" happens when:
- The Bot’s Application Registration is configured as Single-Tenant
(Supported account types = Accounts in this organizational directory only) - The Bot application requests a token from the Bot Framework tenant:
- https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token
- Since the App Registration is Single-Tenant, only the home tenant can issue tokens.
- The Bot Framework tenant is not the home tenant → token issuance fails.
All the operations shown in diagram except business logic is automatically handled by the SDK (BotSDK or AgentsSDK) but the Developer gets control correct token endpoint.
- Bot SDK automatically infers the token endpoint/Authority based on the configuration:
- If you are using BotFrameworkAdapter Class (Microsoft.Bot.Builder) | Microsoft Learn - it will always make calls to "https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token". Thus, it cannot work with SingleTenant or UserAssigned MSI Bot.
- If you are using CloudAdapter Class (Microsoft.Bot.Builder.Integration.AspNet.Core) | Microsoft Learn, it supports configuring the Bot Identity using the MicrosoftAppType. Review samples to understand how this is configured for different runtimes:
- M365 Agents SDK - This is a successor of Bot SDK and will be the only supported SDK after December 2025:
- The Identity configuration is flexible and simplified in Agents SDK. The concepts remain same, appropriate token endpoint/authority needs to be used.
Migration fromMultiTenant SingleTenant to in the Bot code:
- With announcement of the Bot-Builder SDK deprecation, we recommend moving to Agents SDK which retains many Bot Builder concepts with ability to create next generation Agents with orchestration, observability and more secure options authentication.
- For Bot SDK to work with SingleTenant, you must use CloudAdapter Class (Microsoft.Bot.Builder.Integration.AspNet.Core) | Microsoft Learn and configure correct MicrosoftAppType.
I hope it helps.