azureazure-qna-maker

Azure Web App Bot - Linked to Another Account's Knowledgebase


Is there a way I can get the Web App Bot from one account query the knowledebase from QnA Maker of another account on Azure? With my corporate account, I can create a QnA Maker knowledgebase but I do not have permission to create a bot on Azure (requires creating a Microsoft App ID, which I cannot).

What I have done so far -

  1. Build a knowledebase on QnA Maker
  2. Used the QnA Maker client library (Python SDK) to query the knowledebase (works fine)
  3. Hosted the Python app on Streamlit to give a GUI to the end users

I am open to other ways of building a "true" chatbot interfact like the web app bot or the one from DialogFlow.


Solution

  • Yes, this is possible. You just need the the endpoint, knowledge base id, and EndpointKey which are given when you publish your KB as shown below.

    POST /knowledgebases/********-****-****-****-************/generateAnswer
    Host: https://QNA_SERVICE_NAME.azurewebsites.net/qnamaker
    Authorization: EndpointKey ########-####-####-####-############
    Content-Type: application/json
    {"question":"<Your question>"}
    

    With that information you can make the call from anywhere - bots, websites, whatever. Personally I like writing my own helper function to make the HTTP call with the above information. But you can also use a module like QnAMaker from the botbuilder-dialogs library (const {QnAMaker} = require('botbuilder-ai')). I would assume there is an equivalent package in nuget.