I set up a new Single tenant Azure Bot and deployed Bot Framework solution to an azure web app using CI/CD pipeline. Im using the Bot Builder template "Core Bot with Test" out of the box this template runs fine locally. I updated the target framework .net 8 and set the azure web app my azure bot is hosted on to .net 8 as well.

When I just try to test my deployed bot inside the Test in Web Chat tab offered inside the azure bot theres i see the word ..connecting then the webchat window goes blank. I look inside the "issues" part in the WebChat Channel, and it says the following message: There was an error sending this message to your bot: HTTP status code InternalServerError.

I don't believe I have made any errors in app settings as I have set the following in the appsettings tab in the Azure Web App

"MicrosoftAppId" "MicrosoftAppPassword" "MicrosoftAppTenantId"

Also I have appinsigts hooked up and just gives the following exception: App Insights just throws this error: 

Call Stack: Microsoft.Bot.Schema.BotException:
   at Microsoft.Bot.ChannelConnector.BotAPI+<PostActivityToBotAsync>d__44.MoveNext (Microsoft.Bot.Base.ChannelConnector, Version=3.2.4.7, Culture=neutral, PublicKeyToken=null: C:\__w\1\s\ChannelSDK\Microsoft.Bot.Base.ChannelConnector\API\BotAPI.cs:539)
Inner exception System.Exception handled at Microsoft.Bot.ChannelConnector.BotAPI+<PostActivityToBotAsync>d__44.MoveNext:
   at Microsoft.Bot.ChannelConnector.BotAPI.ThrowOnFailedStatusCode (Microsoft.Bot.Base.ChannelConnector, Version=3.2.4.7, Culture=neutral, PublicKeyToken=null: C:\__w\1\s\ChannelSDK\Microsoft.Bot.Base.ChannelConnector\API\BotAPI.cs:701)
   at Microsoft.Bot.ChannelConnector.BotAPI+<PostActivityToBotAsync>d__44.MoveNext (Microsoft.Bot.Base.ChannelConnector, Version=3.2.4.7, Culture=neutral, PublicKeyToken=null: C:\__w\1\s\ChannelSDK\Microsoft.Bot.Base.ChannelConnector\API\BotAPI.cs:521)
, Message: POST to DR_BOT_2024 failed: POST to the bot's endpoint failed with HTTP status 500
1

There are 1 best solutions below

0
Garage Karate On

This error message was due to me forgetting to set the MicrosoftAppType in the Application Configuration of the web app or appsetings.json.

Because I provisioned the bot as a single tenant I needed to set the entry as the following: MicrosoftAppType SingleTenant

After that the Bot worked inside the test in web chat tab immediately.

More information can be found here: https://learn.microsoft.com/en-us/azure/bot-service/provision-and-publish-a-bot?view=azure-bot-service-4.0&tabs=singletenant%2Ccsharp#create-an-identity-resource