Creating QnA Bot for MS Teams using Azure Bot Service and QnA Maker

In this article let’s discuss how to configure Flutter for development in windows machine.

Microsoft Team Bot allows us to interact with users and provide information in different ways like text, search, and conversational manner. Whereas QnA Maker allows us to create a customized Question and answer. It is easy to create, edit, and train QnA Maker Service based on our bot Question and Answer requirement. They also provide default Question and answer.

Prerequisites to create QnA Maker bot in Teams

  • Azure subscription with enough permissions to create Azure Bot Services and QnA maker
  • Licenses to run MS Teams and a bot in it

Azure subscriptions trial versions are also available in this link

How to create Azure Bot Service

  • Log in to the Azure portal and create a new “Web App Bot” resource as shown below:
  • Click on the “Create” and which will allow us to fill the following details of our Web App Bot. For additional information to create Web App Bot refer this link
  • Now Click on the “Create” button.

How to create a Bot and Knowledge Base

  • To build the knowledge base for our bot, go to the QnA maker portal.
  • Log in to the QnA Maker, use the same Microsoft account that we used for Azure. Now click on the “Create knowledge base” tab.
  • To create an Azure QnA service for our KB, click on the “Create a QnA Service” as shown below:
  • Now fill the required details in the Azure portal that allows us to define the QnA service. Click on the “Review + Create” button.
  • Now click on the “Refresh” button and then select the Azure tenant, subscription name, and QnA service to build the knowledge base as shown below:
  • Next, Mention the specific name for KB. Manually create a file for the Question and Answers or we can also simply add any FAQ url page, like MS Build 2019 FAQ URL
  • Specify the bot personality and finally click on the “Create your KB” button
  • Now KB will display a list of questions and answers that it parsed from the URL and we can also add the questions and answers by selecting the “Add QnA pair”. After editing the KB, click on the “Save and train” button.
  • We can test the KB by selecting the “Test” button as shown below:
  • Select the “Publish” tab and click on the “Publish” Button to publish our knowledge base
  • Now we get a success message and then important information such as Knowledgebase ID, host URL, and Authorization key will be provided by QnA Maker as shown below. Copy it for later use.

How to configure QnA maker Knowledge base in Azure Bot Service

  • Go to the Azure portal and navigate to the Application Settings for our Bot. On the “QnAAuthKey”, the “QnAEndpointHostName” and the “QnAKnowledgebaseId” enter the authorization key, host URL, and Knowledgebase ID respectively.
  • Click on the “Save” button and now our bot is connected to QnA service as shown below:
  • We can test our bot by click on the “Test in Web Chat” menu in the properties pane which allows us to chat with the bot directly and see the results.
  • Now our bot is working, so we can proceed to connect with MS Teams by selecting the “Channels” properties tab in App Service. From here we need to select the MS Teams icon as shown below:
  • Now MS Teams allow us to chat with our bot as shown below

I hope this article helps you understand how to configure Azure Bot Service and QnA maker and how to deploy the same in Microsoft Teams. In my upcoming blog, I will explain how to create a QnA bot in MS Teams with coding in Visual Studio 2019.

Sharing is Caring!

Leave a Reply

Your email address will not be published. Required fields are marked *