I am trying to test my Teams Bot in Teams application. I validated and added bot to my team. Look like I need an Azure app service to run the, so I deployed the app to Azure. But the bot in teams, nor 'Test in Webchat' in Azure bot doesn't work. I followed probably all guides, including troubleshooting and in the Azure Bot resource I can see:
There was an error sending this message to your bot: HTTP status code Unauthorized
In App service Log Stream I could see:
HTTP Error 401.0 - Unauthorized
You do not have permission to view this directory or page.
Most likely causes:
The authenticated user does not have access to a resource needed to process the request.
Things you can try:
Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
I checked Ms App ID and client secret. In appsettings.json, Azure App Registration and in OAuth connection in Azure Bot are all the same. The bot is working on localhost with emulator with and without authorization.
We have another bot already running with Teams. I noticed that there is the same Ms App ID in Azure Bot and App registration. Is that as it should be? The bot described above have different ID in Azure Bot resource and App registration. I was trying to find if I can make it, but without success.
Frankly speaking, I don't know what is this address:
GraphInterfaceService is name of App Service in Azure, but endpoint URL is different. And I added /api/messages/ to it.
Furthermore, when I am trying to add "Chat.ReadWrite.All" in OAuth setting sopces (Chat.ReadWrite.All exists in App registration!) it shows me this error on Test connection (but does it matter what scopes are in here? Don't know if they are used to obtain those scopes for general traffic):