1
votes

I have a curious issue/non-issue with my Faq QnAMaker knowledgebase configuration.

When I send a question in the bot emulator:

  1. Message sent to the bot.
  2. Luis determines the proper intent; Emulator shows Luis Trace - looks exactly as I expect.
  3. Emulator shows QnAMaker Trace with "Unable to find a QnA Maker service with Knowledge Base ID [ID]. Please add a QnA Maker service to your bot."
  4. Bot returns the knowledgebase result exactly as I expect, despite the previous message in the trace.

The trace is sent to the emulator after the following code executes in MainDialog.

var answers = await qnaService.GetAnswersAsync(dc.Context, null, null);

I browsed through the locals while debugging, but did not see anything that stood out.

Faq knowledgebase is in the cognitivemodels.json with the form,

"knowledgebases": [
  {
    "name": "KB-NAME",
    "subscriptionKey": "SUBSCRIPTION KEY FROM AZURE COG SERVICE",
    "id": "KB-NAME",
    "hostname": "https://HOSTNAME.azurewebsites.net",
    "kbId": "KBID-FROM-QNAMAKER-SETTINGS-DEPLOYMENT-DETAILS",
    "endpointKey": "ENDPOINT-KEY-FROM-QNAMAKER-SETTINGS-DEPLOYMENT-DETIAILS"
  }
]

and appsettings.json has the following added in accordance with this Microsoft example

"qnaMaker": {
    "endpoint": "ENDPOINT-FROM-AZURE-QNA-COG-RESOURCE",
    "key": "KEY-FROM-AZURE-QNA-COG-RESOURCE"
  },
  "QnAKnowledgebaseId": "KB-ID-FROM-QNAMAKER-SETTINGS-DEPLOYMENT-DETIAILS", // Also tried kb name from cogmodels.json
  "QnAAuthKey": "AUTH-ENDPOINT-KEY-FROM-QNAMAKER-SETTINGS-DEPLOYMENT-DETIAILS",
  "QnAEndpointHostName": "https://HOST.azurewebsites.net/qnamaker"

Am I overlooking something in my configuration details? The main source of my confusion is that it works as expected aside from the ominous trace that shows the QnA Maker service wasn't found.

2
I wouldn't worry about it. I get a similar message in the emulator when hitting LUIS (but only when it subsequently calls QnA Maker), but everything still works as expected. Here is the message I get: "Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource." - billoverton
@billoverton I was getting that in the past. Adding my app id/pass to the appsettings resolved it for me. I'll try publishing everything and seeing if it still works in a web chat. I'm not sure what the intent of the messages are if they don't truly mean anything, and the services still work as expected. Strange! - Roy
That could be a discrepancy for me...I don't have app ID/password set for local testing (though it is still hitting the LUIS and QnA Maker services on Azure). - billoverton

2 Answers

1
votes

In this case you may have passed the wrong ID in your localhost it was the problem for me.

check your QNMakerBaseID in your bot configuration in azure

1
votes

You need to add your QnA info into *.bot file:

{
    "type": "qna",
    "endpointKey": "",
    "hostname": "",
    "id": "3",
    "kbId": "",
    "name": "",
    "subscriptionKey": ""
}

Then your in your Bot Framework Emulator you will see the details of the result coming from QnA