0

Hello i publish my bot to azure and have this error when i tested it on messenger. I downloaded the publish settings on my azure app and import it to the bot via Visual Studio. I have done this many times before but this is my first time publishing on the latest botframework design.

This bot is working fine on bot emulator including luis, qnaMaker and dispatch services.

I saw this question but LuisAPIHostName in my appsettings.json is already set to region.

Any idea how to solve this? Thank you enter image description here I can see the error because of this code

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);

My 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; }
}

Dispatch keys and endpoint enter image description here

LUIS keys and endpoint enter image description here

wwwroot enter image description here

emulator with working luis,dispatch and qna(btw the error only appears when i click "trace" in the emulator) enter image description here

UPDATE

i changed appsettings to

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

and botservice to

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

In messenger, it is now replying but detecting everything i type as "cancel" intent. I added a code to see intent and you can see the difference between emulator and messenger.

enter image description here

I typed the same thing on emulator but luis,qna and dispatch is working fine.

![enter image description here

user10860402
  • 912
  • 1
  • 10
  • 34
  • Hi , have you configed "MicrosoftAppId" and "MicrosoftAppPassword" in appsettings correctly ? – Stanley Gong Aug 22 '19 at 08:37
  • Hi i tried adding tjhem just now to app settings. publish again but still same error. "No such host is known" – user10860402 Aug 22 '19 at 09:16
  • For others, [this is OPs GH question](https://github.com/microsoft/BotBuilder-Samples/issues/1722) and [this is a related PR discussion](https://github.com/microsoft/botbuilder-js/pull/1083) – mdrichardson Aug 22 '19 at 17:35
  • Your code looks fine and it appears you're using the correct endpoint format. Can you verify that `LuisAPIHostName` is set to `southeastasia` in `Azure Portal > Your Resource Group > App Service > Configuration`? Can you also verify that your deployed bot matches your local bot? You can view the files at `https://.scm.azurewebsites.net/dev/wwwroot/` – mdrichardson Aug 22 '19 at 17:38
  • @mdrichardson-MSFT i have updated the question with images Sir Richardson – user10860402 Aug 23 '19 at 01:35
  • @mdrichardson-MSFT i change the hostname and bot service and now it is replying but detecting everything as cancel intent. This is working good in emulator so i really find it weird. i can give you the code in git if you want sir. – user10860402 Aug 23 '19 at 01:55
  • @mdrichardson-MSFT think i should answer this by doing what i did in bot service and appsettings and ask another question about the consistent cancel intent? – user10860402 Aug 23 '19 at 10:35
  • Can you verify that `LuisAPIHostName` is set to "southeastasia" in `Azure Portal > Your Resource Group > App Service > Configuration`? Can you also verify that your keys are correct in that same location in the Azure Portal? – mdrichardson Aug 23 '19 at 16:02
  • Feel free to link to your code if that doesn't work. – mdrichardson Aug 23 '19 at 16:08
  • Also, I tested your bot and it looks like the [the "help" intent is working fine](https://imgur.com/Fu4Cjwu) – mdrichardson Aug 23 '19 at 16:16
  • @mdrichardson-MSFT I think this question is answered by what i did in the update. also i found a fix for the different intent detection in emulator and messenger. i think you will be interested Sir Richardson by how i fixed it but i have not posted the answer yet. here is the link to the question https://stackoverflow.com/questions/57625246/luis-only-picking-up-2-intent-when-published-in-azure-but-is-working-perfectly-i – user10860402 Aug 23 '19 at 16:37
  • @mdrichardson-MSFT also i can not found the app service for luis. only cognitive service. follow up question can you put luis,qna and bot service in one app service or app service plan? is it okay if they have individual app service or should i put them in one app service. – user10860402 Aug 23 '19 at 16:46
  • @mdrichardson-MSFT i posted my answer to this question. can you explain why my answer work and why my posted code does not work sir? https://stackoverflow.com/questions/57625246/luis-only-picking-up-2-intent-when-published-in-azure-but-is-working-perfectly – user10860402 Aug 23 '19 at 16:58
  • @user10860402 Can you link to your code? – mdrichardson Aug 23 '19 at 17:07
  • @mdrichardson-MSFT i posted my code in the question here and also the answer. i also have it pushed in a private repo in github. https://stackoverflow.com/questions/57625246/luis-only-picking-up-2-intent-when-published-in-azure-but-is-working-perfectly-i – user10860402 Aug 23 '19 at 17:10
  • @mdrichardson-MSFT please tell my if you want to see full code in git or the code in question is enough. it is dawn now here and i have to sleep. will reply first thing when i wake up thank you Sir Richardson – user10860402 Aug 23 '19 at 17:14
  • @user10860402 I don't believe this one is solved (see my answer in your other issue). However, it's so related to the other issue that I will continue this conversation there. – mdrichardson Aug 23 '19 at 21:15
  • @user10860402 I don't believe this one is solved (see my answer in your other issue). However, it's so related to the other issue that I will continue this conversation there. – mdrichardson Aug 23 '19 at 21:15

0 Answers0