Reputation: 111
I created a Web app bot in Azure portal. LUIS, App service, Insights got created automatically. This is a Basic bot using SDK-V4. It got created successfully. But after it when i tried to test the bot using "Test in Web Chat" it gave the "Failed to send activity: bot returned an error". I didn't even deployed any code for the bot. PFB the screenshot of the issue below.
I just downloaded the bot source code and did some changes. It is working fine in Emulator by getting connected to LUIS. But in "Test using web chat" it is not working even with or without deployment of code. I checked the following already:
Actual getting results:
In App Insights:
Message : POST to SAP_Bot-DEV failed: POST to the bot's endpoint failed with
HTTP status 500 POST to the bot's endpoint failed with HTTP status
500.
Failed Message: Microsoft.Bot.ChannelConnector.BotAPI.ThrowOnFailedStatusCode
Call Stack:
Microsoft.Bot.Schema.BotException:
at Microsoft.Bot.ChannelConnector.BotAPI+<PostActivityToBotAsync>d__31.MoveNext (Microsoft.Bot.Base.ChannelConnector, Version=3.2.3.0, Culture=neutral, PublicKeyToken=null)
Inner exception System.Exception handled at Microsoft.Bot.ChannelConnector.BotAPI+<PostActivityToBotAsync>d__31.MoveNext:
at Microsoft.Bot.ChannelConnector.BotAPI.ThrowOnFailedStatusCode (Microsoft.Bot.Base.ChannelConnector, Version=3.2.3.0, Culture=neutral, PublicKeyToken=null)
at Microsoft.Bot.ChannelConnector.BotAPI+<PostActivityToBotAsync>d__31.MoveNext (Microsoft.Bot.Base.ChannelConnector, Version=3.2.3.0, Culture=neutral, PublicKeyToken=null)
In Browser:
{error: {code: "BotError", message: "Failed to send activity: bot returned an error"},…}
error: {code: "BotError", message: "Failed to send activity: bot returned an error"}
httpStatusCode: 500[In Browser][1]
[App Insights Screenshot][2]
Upvotes: 1
Views: 3797
Reputation: 111
The issue got resolved. Initially we created the MS application ID and password manually by creating an application in azure portal. There was some issue with the manually created ID, then we tried with automatic app ID creation (after getting required authorization in azure portal) and it works. Thank you all for your support.
Upvotes: 0
Reputation: 121
Try publishing your bot and check if the messaging endpoint url is not set to localhost but to your published url in azure and in registration portalset your messaging endpoint as the redirect url
Upvotes: 0