Azure Bot and Webchat: There was an error sending this message to your bot

Viewed 290

I created a bot, deployed it on azure via GitHub actions and tested in the emulator, everything works fine, but when i try to connect the channel "Webchat" i keep receive errors like

There was an error sending this message to your bot: HTTP status code GatewayTimeout
There was an error sending this message to your bot: HTTP status code Unauthorized
There was an error sending this message to your bot: HTTP status code BadGateway

but it kinda changes randomly without me changing anything. Of course i set messaging endpoint in the Configuration tab (The same as i was testing in the emulator, https://appservicename.azurewebsites.net/api/messages) and the check for Enable Streaming Endpoint. The question is: how to i fix this or how can i even find a solution when the errors are not always the same?

UPDATE More info: I made my app from basic code, i have my

const adapter = new BotFrameworkAdapter({
    appId: process.env.MicrosoftAppId,
    appPassword: process.env.MicrosoftAppPassword
});

ID is taken in Azure Bot Configuration Tab. Password is created in App Secrets Key Vault, manually created under Secrets.

What im doing wrong?

1 Answers

According to this MSFT documentation, this can happen if you use a self-signed certificate.

If the chat window indicates one or more errors, click the error(s) for additional information. Among the most common issues are:

  • The bot's endpoint is specified incorrectly in the emulator settings. Ensure that the URL contains the correct port number and the correct path at the end of the URL.
  • A bot endpoint that starts with https is specified in the emulator settings. The endpoint on localhost should start with http.
  • The Microsoft App ID field and/or the Microsoft App Password fields in the emulator settings do not contain valid values. Both fields should be filled in, with each field containing the corresponding data.
  • Security has not been enabled for the bot. Verify that the bot configuration settings specify values for both app ID and password.

Also, try modifying the App Service's Protocol Setting. If you used Bot Composer to deploy your bot, you'll notice two App Services in the resource group: one with a 'qna' suffix and the other without. Choose the one that does not end in 'qna.'

Select the App Service --> TLS/SSL settings --> HTTPS Only --> On

References - Ref1, Ref2, Ref3.

Related