Create Azure Bot Service Using QnA Maker

 Introduction to Azure Bot

Azure Bot Service is very popular and helps you to speed up the development by providing an integrated environment that is specially built up for bot development. With the cognitive services, it helps you enable your bot to see, hear, and interpret in more human ways.

The best advantage of Azure Bot Service is that it can be integrated across multiple channels to increase the interaction by using your website or app to email, GroupMe, Facebook messenger, Skype, Slack, Telegram, Cortana, And Skype for business.

QnA Maker 

QnA maker integrates with other APIs and solutions seamlessly and at scale to know it all part of a bigger bot or great standalone. Create a bot dialog or filing in a table. So, you need to feed the questions and relevant answers in the QnA Maker that you can test in your Azure Bot Service chat window.

Let’s started on how to create Azure Bot Service and interact with QnA Maker.

  • Login to your Azure Account.
  • Click on "Create a Resource" in the left side corner of the screen.

    Azure Bot

  • Select "AI + Machine Learning" option.

    Azure Bot

  • Then, select Web App Bot Service.
  • Give the Bot name, select resource group, or create new. If you don’t have, select location, pricing tier, app name.
  • Choose Bot Template as question and answer.

    Azure Bot

  • Select App Service plan and select or create new Azure Storage according to the use.
  • Now, select Auto create App ID and password.

    Azure Bot

    Azure Bot

  • Finally, click on "Create".
  • So, once it is successfully deployed.
  • Now, open https://www.qnamaker.ai/
  • Make sure you sign in with your same account from which u sign in with your Azure account.
  • Once you sign in to your account, click on "Create a knowledge base".

    Azure Bot


  • Then, in step 1, create a QnA Service in Microsoft Account, i.e., on Create a QnA Service.
  • It will redirect/land to the Azure account.

    Azure Bot

  • Fill all the required details, like Name, Tier, Resource group, Location, App name, website location etc.

    Azure Bot

  • Then, click on "Create".
  • After this, go back to QnA Maker and complete the second step.
  • In the second step, you need to connect your QnA service to your KB so select Azure Account directory, Account subscription name, Azure QnA service name.
  • Step 3 – you can name your service if you want.
  • Step 4 – you can also make a doc, Excel of question and answer pair and add the file or give URL in this step.
  • Finally, follow the step 5, i.e.m click on "Create your KB".

    Azure Bot
  • Add QnA pair, which means now, you have to add questions and relevant answers of it.
  • Then, click on "Save and Train" button on the top.

    Azure Bot

  • Then, click on Publish Tab and click the Publish button and get it published.

    Azure Bot

  • Once you click on Publish button, you will get HTTP request to build your bot, so that means your service is successfully deployed so make a note of that published HTTP request content in Notepad or Word file.
    Azure Bot

  • Now, go to your Bot Service.
  • Go to "Application Settings" tab.

    Azure Bot

  • You have QnAKnowledgebaseId, QnAAuthKey, QnAEndpointHostName - three values in the format of key value pair.
  • You will get the above values from QnA Maker publish Http request content.
    Azure Bot
  • Copy and fill the relevant value in the application setting tab.
  • Then click on save button.

    Azure Bot

  • For Testing your Web App Bot Goto -> Bot Management section then click on Test in Web Chat tab.
  • Now you can test your bot , so give the question and you will get relevant answers which you feed.

    Azure Bot

So this is how you can create a Bot Service with QnA Maker.

Hope you like my article. In case of queries, you can write to me in the comment box below.


Similar Articles