Hello Mathis LAURENT,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you are having AADSTS700016: Application with identifier 'xxxxxxxxxxx' was not found in the directory 'Bot Framework' error.
If you're manually requesting tokens, check Authentication Code and make sure your code uses the correct:
- Client ID
- Tenant ID
- Authority URL
- Scopes
For the fact that the error is related to Azure Active Directory (AAD) authentication and typically means that the bot's Azure AD app registration is either misconfigured or not properly recognized by the tenant. The error suggests the request might be going to the wrong tenant. So, in your bot configuration or authentication request, check that you're using the correct tenant ID or common/multi-tenant endpoint if applicable such as:
- Single tenant: https://login.microsoftonline.com/{tenant-id}
- Multi-tenant: https://login.microsoftonline.com/common
And if the app is multi-tenant, ensure that admin consent has been granted in the target tenant:
- Go to API permissions in the app registration and verify.
- Required permissions are listed.
- Admin consent has been granted (especially for delegated permissions).
Among many things you can do:
- Use Azure AD Graph Explorer to test token requests and validate permissions, and;
- Try using Microsoft Authentication Library (MSAL) for token acquisition—it handles many edge cases.
I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.