Botframework发布到蔚蓝的错误。 “没有这样的主机被称为”(Botframework

2019-10-29 08:00发布

你好,我发表我的僵尸Azure和这个错误,当我测试的使者。 我下载我的天蓝色的应用程序发布设置,通过Visual Studio中导入到机器人。 我以前做过很多次,但是这是我第一次发布最新botframework设计。

这个机器人是机器人上包括模拟器路易斯,qnaMaker和劳务派遣工作的罚款。

我看到了这个问题,但LuisAPIHostName我appsettings.json已被设置为区域。

不知道如何解决这个问题? 谢谢 我可以看到的,因为这个代码中的错误

public class AdapterWithErrorHandler : BotFrameworkHttpAdapter
{
    private const string ErrorMsgText = "Sorry, it looks like something went wrong.";

    public AdapterWithErrorHandler(IConfiguration configuration, ILogger<BotFrameworkHttpAdapter> logger, ConversationState conversationState = null)
        : base(configuration, logger)
    {
        OnTurnError = async (turnContext, exception) =>
        {
            // Log any leaked exception from the application.
            logger.LogError($"Exception caught : {exception.Message}");

            // Send a catch-all apology to the user.
            var errorMessage = MessageFactory.Text(ErrorMsgText + exception.Message, ErrorMsgText, InputHints.ExpectingInput);
            await turnContext.SendActivityAsync(errorMessage);

我的AppSettings:

   {
  "Logging": {
    "LogLevel": {
      "Default": "Warning"
    }
  },

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

  "DispatchLuisAppId": DispatchAppId,
  "DispatchLuisAPIKey": DispatchAPIKey,
  "DispatchLuisAPIHostName": "southeastasia",

  "LuisAppId": LuisAppId,
  "LuisAPIKey": LuisAPIKey,
  "LuisAPIHostName": "southeastasia",

  "QnAKnowledgebaseId": QnaMakerKBId,
  "QnAEndpointKey": QnaMAkerEndpointKey,
  "QnAEndpointHostName": QnaMakerEndpointHostName,
  "AllowedHosts": "*"
}

botServices:

 public class BotServices : IBotServices
{
    public BotServices(IConfiguration configuration)
    {
        DispatchService = new LuisRecognizer(new LuisApplication(
        configuration["DispatchLuisAppId"],
        configuration["DispatchLuisAPIKey"],
        $"https://{configuration["DispatchLuisAPIHostName"]}.api.cognitive.microsoft.com"),
        new LuisPredictionOptions { IncludeAllIntents = true, IncludeInstanceData = true },
        true);

        LuisService = new LuisRecognizer(new LuisApplication(
        configuration["LuisAppId"],
        configuration["LuisAPIKey"],
        $"https://{configuration["LuisAPIHostName"]}.api.cognitive.microsoft.com"),
        new LuisPredictionOptions { IncludeAllIntents = true, IncludeInstanceData = true },
        true);

        QnaService = new QnAMaker(new QnAMakerEndpoint
        {
            KnowledgeBaseId = configuration["QnAKnowledgebaseId"],
            EndpointKey = configuration["QnAEndpointKey"],
            Host = configuration["QnAEndpointHostName"]
        });
    }

    public LuisRecognizer DispatchService { get; private set; }
    public LuisRecognizer LuisService { get; private set; }
    public QnAMaker QnaService { get; private set; }
}

调度键和端点

LUIS键和端点

wwwroot文件

仿真器工作的路易斯,调度和QNA(当我在模拟器中单击“跟踪”顺便说一句只出现错误)

UPDATE

我改变的AppSettings到

  "DispatchLuisAPIHostName": "southeastasia.api.cognitive.microsoft.com",

和botservice到

            $"https://{configuration["DispatchLuisAPIHostName"]}"),

在信使,它现在回答,但检测的一切,我输入为“取消”的意图。 我添加了一个代码,查看意图,你可以看到模拟器和信使之间的差异。

我输入了同样的事情,在仿真器,但路易斯,QNA和调度工作正常。

文章来源: Botframework publish to azure error. “No such host is known”