本文介绍了错误(502)错误的网关:当尝试使用WebChat通道访问Azure上部署的聊天机器人时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在使用Microsoft Botframework开发聊天机器人.当我在模拟器上本地运行Bot时,它工作正常.但是,当我将其作为漫游器服务部署到Azure并尝试通过Webchat通道访问它时,却开始出现502错误.我尝试按照以下步骤进行部署.

  • 在Azure中创建资源组
  • 天蓝色地创建服务计划
  • 打开网址

    • 创建机器人"页面将我带到Azure Bot服务页面
    • 在Azure Bot服务页面上,选择"Web App Bot"
    • 在单击创建" Azure时,请向我询问一些详细信息,例如Bot名称,资源组,应用程序名称等,并创建Bot.
    • 在这个新的Bot中,当我转到在Web聊天中测试"并键入一些内容时,它会给我一个回复.
    • 现在,我从设置"中获取了应用程序ID和密钥,并将其添加到Web配置文件中.
    • 现在我从Visual Studio中发布我的机器人,选择新的机器人服务作为应用程序服务
    • 发布成功
    • 现在,当我尝试在Azure的"Web聊天"窗口中的测试"中访问我的机器人时,消息开始失败
    • 我已经从频道部分获取了网络聊天链接,并将其粘贴到html页面上,并更新了用于网络聊天的密钥
    • 现在,当我发送消息时,我开始在控制台中收到(502)错误的网关错误.

    我过去也曾部署过机器人,但那时我使用dev.botframework.com来配置机器人.

    这是我第一次尝试在Azure Bot服务上部署它,不知道我在这里缺少什么.

    有人可以帮我吗?

    解决方案

    错误(HTTP状态代码502)指示漫游器返回错误或请求超时.您可以转到

  • 要在Visual Studio中部署由Bot Builder SDK开发的bot应用程序,可以选择并发布到相应的应用程序服务.

    注意:在将漫游器应用程序部署到Azure Web应用程序时,您可以选中" 在目标位置删除其他文件 "选项>

I am developing a chatbot using Microsoft Botframework. Bot works fine when I run it locally with emulator. How ever when I deploy it on Azure as a bot service and try to access it using webchat channel it start giving 502 error.I am tried following steps to deploy it.

  • Created a resource group in Azure
  • Created a Service Plan in azure
  • open url https://dev.botframework.com/ and under My bots menu item clicked "Create a bot" button
  • "Create a bot" page takes me to Azure Bot Service page
  • On Azure Bot service page I select "Web App Bot"
  • On clicking "Create" Azure ask me few details such as Bot Name, Resource group, App Name etc and creates a Bot
  • In this new Bot when I go to "Test in Web Chat" and type something it gives me a response back.
  • Now I took app id and secret key from Settings and add it to web config file.
  • Now I publish my bot from Visual Studio selecting new bot service as app service
  • Publishing is successful
  • Now when I try to access my bot in Test in Web Chat window in Azure,messages start getting failed
  • I have taken the web chat link from channel section and paste it on html page and updated secret key for web chat
  • Now when I send a message I start getting (502) bad gateway error in console.

I have deployed bots in the past as well but at that I was using dev.botframework.com for configuring bots.

This is first time I am trying to deploy it on Azure Bot service and don't know what am I missing here.

Can someone help me with this?

解决方案

The error (HTTP status code 502) indicates that either the bot returned an error or the request timed out. You can go to the bot's Channels blade and click the "Issues" link for the affected channel to check the information about errors, or use Application Insights to trace error details.

Besides, if possible, you can create a new simple bot application with Bot Builder SDK in visual studio and upgrade the Bot Builder SDK for project, then deploy it to corresponding Azure app service with the following steps&diagrams, and check if new bot application can work with bot service.

  • After you created it, two resources: Web App Bot and App Service are created in your resource group. Something like below:

  • To deploy your bot application developed by Bot Builder SDK in visual studio, you can choose and publish to that corresponding app service.

    Note: you can check "Remove additional files at destination" option when you deploy the bot application to your Azure web app

这篇关于错误(502)错误的网关:当尝试使用WebChat通道访问Azure上部署的聊天机器人时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 00:27