Hi Lorena Basulto (Contractor)
The error AADSTS700016: Application with identifier X was not found in the directory 'Bot Framework' typically indicates that Azure Active Directory (AAD) cannot locate the application registration in the specified tenant. This issue arises when the App ID used for authentication is either incorrect, not registered in the tenant you're targeting, or the authentication request is being sent to the wrong tenant endpoint. In your architecture, the web app communicates with Azure Bot Framework using ClientSecretCredential
(App ID + Secret), and with Azure AI Foundry using either Managed Identity or ClientSecretCredential. Both methods are failing due to an unauthorized_client
error, which points to a misalignment between the app registration and the tenant configuration.
To resolve this, first verify that the App ID is correctly registered in the Azure Portal under the App Registrations section, and ensure it belongs to the correct tenant. If the app is intended to be multi-tenant, confirm that it is properly configured as such and that administrative consent has been granted. You can use the admin consent URL to explicitly grant permissions:
https://login.microsoftonline.com/{tenant-id}/adminconsent?client_id={app-id}.
Additionally, validate that the credentials used—whether a client secret or managed identity—are correctly configured and active. For ClientSecretCredential, ensure the secret is valid and not expired. For Managed Identity, confirm that it is enabled on the web app and has the necessary access to Azure AI Foundry. Also, check that the required API permissions are added and granted in the app registration, especially for accessing Microsoft Bot APIs.
References : Configure your AI project to use Azure AI Foundry Models , Microsoft TechCommunity: Azure AI Foundry/Azure AI Service - cannot access agents
Hope this Helps!
Thanks