将机器人发布到Azure [英] Publish bot to Azure

查看:68
本文介绍了将机器人发布到Azure的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从Visual Studio将我的机器人发布到Azure并在网络聊天中尝试时,它说无法发送消息.在本地运行该机器人,一切正常.

When I published my bot to Azure from Visual Studio and trying it on the web chat, it says can't send the message. Running the bot locally everything works just fine.

当尝试与Azure上的端点聊天时,模拟器报告HTTP 500错误.

The emulator reports HTTP 500 error when trying to chat with the endpoint on azure.

推荐答案

在注释部分进行了一些讨论之后,我从您提供的存储库中提取了您的代码.与您所说的不同,它在启动时也会因HTTP 500在本地崩溃.阅读日志给我web.config的问题.

After some discussions in the comment section, I've pulled your code from the repository you've provided. Different to what you were saying, it also crashes locally with HTTP 500 on start. Reading the logs gave me issues with web.config.

这将导致我找到以下解决方案:

您的代码库包含一个不属于该文件的web.config文件.这是一个.net核心应用程序,因此不应依赖web.config,而应使用

Your codebase contains a web.config file which doesn't belong there. This is a .net core application and therefore should not rely on web.config and instead use appsettings.json. When this web.config gets deployed, the runtime tries to load certain things and crashes with HTTP 500.

不确定此web.config的来源,但我认为是从以前的部署或您的测试中得出的. 我已经向您发送了PR,只需删除此web.config并将您的机器人部署到Azure.

Not sure where this web.config comes from but I assume from previous deployments or some test of yours. I've send you a PR simply removing this web.config and deployed your bot to Azure.

效果很好:

在删除web.config后从Visual Studio中发布文件时,请确保已选择在目标位置删除其他文件.通过这种方式,您可以确保不会意外地将孤立的web.config留在此处.

Make sure you've selected remove additional files at destination when you publish it from Visual Studio after removing web.config. This way you're making sure that you not accidentally leave an orphaned web.config there.

这篇关于将机器人发布到Azure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆