Bot Framework Emulator - 在本地部署机器人并在团队中安装

Bot framework Emulator - deploy bot on premise and install on teams

我正在尝试使用 Bot framework Emulator 创建一个 Microsoft Teams Bot,我可以在内部部署并安装在 Microsoft Teams 上。

我有一个简单的机器人,我从 Bot Framework Composer 开始,当我点击“启动机器人”时工作正常。

  1. 我已将机器人导出为 zip

  2. 我已经 运行 使用了 Visual Studio 2019,效果不错。

  3. 我尝试使用 Bot Framework Emulator 进行连接,效果不错。

  4. 我已经在本地 IIS 上部署了相同的 bot,我已经成功地使用 Bot Framework Emulator.

    连接到 bot

什么不起作用

我已将机器人部署到远程服务器。当我尝试使用模拟器时,它不再工作了。 我得到的错误是 Error: The bot is remote, but the service URL is localhost. Without tunneling software you will not receive replies.

Microsoft Teams 中使用 App Studio 我完成了以下步骤:

  1. 使用以下功能创建新应用程序
  2. 在“App Details”中填写输入并生成一个新的App ID,生成的AppId,我在appsettings.json上设置为键MicrosoftAppId
  3. 在“机器人”菜单上,我设置了一个新的机器人。
  4. 配置“消息端点地址”
  5. 在“测试和分发”上点击在团队中安装您的应用程序进行测试。

机器人真的很安静,我做错了什么?

如果我对你的问题的理解正确,你正在尝试从本地 运行 Teams 上的机器人。我不明白你为什么要尝试使用 Bot Framework Emulator.

为了从本地在 Teams 上调试和 运行 机器人,您可以通过以下两种方式进行操作:

  1. Debug a bot from any channel using ngrok. It requires a subscription to Microsoft Azure.
  2. 如果您没有 azure 订阅,可以尝试使用 App Studio。您做得很好,只是需要将 https://example.ngrok.io/api/messages URL 或 public 面向 URL 部署的机器人服务,放在消息传递端点中。

对于运行 ngrok,这里是命令ngrok http 44327 -host-header=localhost:44327。相应地更改端口,您可以查看 Properties -> launchSettings.json 以了解您的端口或更改(在 c# 中)。

一些有用的文档:

  1. Prerequisites: Get started with Microsoft Teams app development
  2. Build your first conversational bot for Microsoft Teams