Search code examples
javascriptc#botframeworkdirect-line-botframework

Bot framework Direct Line 502 error


I have been trying to connect to my bot via DirectLine using this code on an html.

<!DOCTYPE html>
<html>
  <head>
    <link href="https://cdn.botframework.com/botframework-webchat/latest/botchat.css" rel="stylesheet" />
  </head>
  <body>
    <div id="bot"/>
    <script src="https://cdn.botframework.com/botframework-webchat/latest/botchat.js"></script>
    <script>
      BotChat.App({
        directLine: { secret: 'xxxxx' },
        user: { id: 'userid' },
        bot: { id: 'botid' },
        resize: 'detect'
      }, document.getElementById("bot"));
    </script>
  </body>
</html>

I already checked the direct line secret and it is okay. When I test this code, the chat appears and I recieve the Hello! message I set up on the bot but when I try to send a message to the bot I get this error on console from web browser 502 ERROR FROM CONSOLE

How can I use the DirectLine properly or what am I missing from the code for it to send the messages?


Solution

  • I checked the Azure status history and find a issue with bot service appeared on 6/14, which might cause communicating with bot not work as expected.

    enter image description here