首页 > 解决方案 > luis 在 azure 上发布时机器人抛出错误,但在模拟器上工作正常

问题描述

我使用带有中间件的 c# 在框架 v4 中制作了机器人。它在模拟器上运行良好,但在 azure 上发布后抛出错误。谁能知道它的可能原因。它主要在 azure 上抛出 luis 部分的错误。错误消息是对不起,看起来出了点问题:没有这样的主机是已知的......请任何人帮助我

{
     "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Warning"
    }
  },
  "ConnectionStrings": {
    "DBConnection": ""
  },

  "smsApiUrl": "",
  "Employee": "",
  "Token": "",

  "MicrosoftAppId": "",
  "MicrosoftAppPassword": "",

  "BotBasePath": "/api",
  "BotMessagesPath": "/messages",
  "AzureTableStorageConnectionString": "",
  "RejectConnectionRequestIfNoAggregationChannel": true,
  "PermittedAggregationChannels": "",
  "NoDirectConversationsWithChannels": "emulator, facebook, skype, msteams, webchat",


  "LuisAppId": "",
  "LuisAPIKey": "",
  "LuisAPIHostName": "westus",

  "QnAKnowledgebaseId": "",
  "QnAEndpointKey": "",
  "QnAEndpointHostName": ""
}

标签: c#botframeworkmiddlewareazure-language-understandingqnamaker

解决方案


由于机器人在本地模拟器上运行良好,问题似乎是您在 Azure 上发布机器人的方式。要遵循的一些故障排除步骤是:

  • 检查您是否正确配置了 appsettings.json 中的“Microsoft AppID”和“Microsoft AppPassword”。
  • 验证 LuisAPIHostname 在 Azure 门户 > 您的资源组 > 应用服务 > 配置中设置为“westus”
  • 仔细检查 Azure 门户中的密钥是否正确。
  • 验证您是否错过了在 Azure 上部署机器人的任何步骤。

推荐阅读