In my last article “Build FAQ Knowledge Base with QnA Maker”, I have explained steps to create knowledge base from existing FAQ pages using QnA Maker service.
In this blog as a next step, I will explain how we can convert this FAQ knowledge base into a chatbot using Azure Bot Service.
To use Bot Service, if you have at least an Azure Account. If not, you can start one for free. To create a Bot, follow the below steps:
- Log into the Azure Portal
- Click on New > AI + Cognitive Services > Web App Bot
- A new blade will open with information about the Web App Bot.
- In the Bot Serviceblade, provide the requested information to create a Bot Service:
- Bot Name: This will be our Bot name and used to respond to Chat with the user
- Subscription: Microsoft Azure Subscription, you can very well try this out with the free trial subscription also.
- Resource Group: This is a logical grouping of all Azure resources. Bot service is part of Azure resources it must be associated with either existing resource group or create a new resource group.
- Location: Select the data center region you would like to use
- Pricing tier: This defaults to S1 Standard, change this to FO (10K Premium Messages) Or else you will pay for the service
- App Name:It should be unique application name for the bot which consists of alphanumeric and underscores characters only up to 35 characters. The App name cannot be changed once the bot is created.
- Scroll down and fill remaining details:
- Bot template: As we are using FAQ knowledge base which is in question and answer form, select Question and Answer
- App service plan/Location: You will need to create a new one or use an existing.
- Azure Storage:This is a data storage account. You can create either a new or use an existing one.
- Application Insights:This service is not free, so be careful about turning it on.
- Microsoft App ID and password: Select Create New option if you need to enter a Microsoft App ID and password manually. Otherwise, a new Microsoft App ID and password will be automatically created for you in the bot creation process. See the below image:
- Click Createto create an Azure Bot. It will validate provided choices, and on completion, it will begin the deployment.
- On completion of deployment, we would have Azure Bot service. Now to consume the knowledgebase we have created using QnA Maker service, we need to connect both services.
- To connect the Azure Bot service, select your bot, it’ll be the one which has a TYPEof Web App Bot
- From the left menu, click on APP SERVICE SETTINGS > Application Settings.
- Scroll down to App settings There are two blank settings called QnAKnowledgebaseId and QnASubscriptionKey.
- Provide your valid QnAKnowledgebaseId and QnASubscriptionKey from your QnA Maker service.
- Click Save
- To test this newly created Bot, click on Test in Web Chat on the left side and ask queries based on the knowledge base.
- By default, bot will be configured and running for Web Chat
- To check all the channels for this bot, click on Channelson the left menu. There are more channel options available like Teams, Skype, Cortana, etc.
- To test a chatbot in Web Chat, click on Test in Web Chat option under BOT MANAGEMENT section in the left panel
- Now enter a message and bot should respond leveraging the knowledge base created using QnA Maker service.
Note: If the Web Chat control is not fully loaded after a few minutes, try refreshing the page.
In this blog, I have explained how you can create a basic Web App Bot by using Bot Service and tested the bot's functionality by using the built-in Web Chat control within Azure. I hope the entire blog series helped you understand and explore the capabilities of Azure Bot Service and QnA Maker service. You can view the entire blog series here:
- Everything about Microsoft QnA Maker
- Build FAQ knowledge base with Qna Maker
- How to convert FAQ into a Bot using Azure Bot Service