I am trying to generate a JWT token using UserAssignedMSI Bot Type for authenticating requests from the Bot Connector service to our bot.
Attempted to generate a token with the common bot authority using the Managed Identity ID.
Encountered the following exception:
AADSTS700016: Application with identifier ‘managed identity 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.
I am referring the below mentioned document for this implementation and it is mentioned that issuer of token should be https://api.botframework.com
https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-authentication?view=azure-bot-service-4.0&tabs=userassigned#step-1-request-an-access-token-from-the-azure-ad-v2-account-login-service
Questions:
How can I resolve the AADSTS700016 exception?
How can i generate a JWT token using DefaultAzureCredential or ManagedIdentityCredential with Azure.Identity package in C# for my Bot using Managed Identity ID and Authority or resource as https://api.botframework.com
What steps are needed to ensure the Managed Identity ID is correctly recognized in the Bot Framework directory?
Are there specific configurations or permissions required for the Managed Identity in Azure AD to authenticate with the Bot Connector service?