Skip to main content

Create an FAQ chat bot Part 2 Azure Bot Service

Following on from part 1, you should now have your knowledge base created using QnA Maker. The next step is to create an Azure bot service and connect that to your table of question and answer pairs.

Head over to your Azure Portal , If you don’t already have a subscription in place, you can sign up for  a pay as you go plan, The bot service we will be creating has a free tier, of 10k messages so we don’t need to worry about any costs for this demo.

In your Azure portal select create a resource in the top left corner. Search for “Functions Bot”. Select functions bot as highlighted in the screenshot below and hit create.

Proceed to enter details for your bot service. Name your Bot service, select your subscription if you are using pay as you go, create a new resource group. In the pricing tier make sure you change that from S1 to F0 this is the free pricing tier. Another important step, select the bot template section and choose under c# Question and answer.

Fill out all the relevant information and create your bot service.

Whiles azure is creating your bot we`ll head back to QnA maker to grab a few details. Go to your My Services section in QnA Maker select view code on your service and make a note of your knowledge base id and your subscription key, both highlighted in the screen shot below.

Head back in to azure and locate the functions bot we just created. Select All resource groups in the side bar menu, select the name of your resource and then finally select your functions bot, not the app service as they may have the exact same name.

Go to the Application settings of your bot , copy and paste in  your QnA knowledge base id, which is the GUID in the HTTP post request and your subscription key. Hit save, your bot should now be linked to your QnA maker questions and answers. Last and finally step is to get the iframe code in order to embed the bot onto our webpage.

Switch to the Channels tab on your bot app. You`ll notice there is already a web chat channel, select edit. Copy the embed iframe code onto your webpage, and replace the text YOUR_SECRET_HERE with one of your secret keys by showing , copying and pasting.

As you can see back in the channels tab there were multiple channels available you can experiment with such a Skype for business , Facebook messenger and even Microsoft teams.

Any additions you now make in your QnA maker knowledge base, once you save retrain and publish will automatically reflect in your bot.


Charles Osei

Dynamics 365 Consultant @ Hitachi MCSE Business Applications Computer Science – University of Lincoln 2017 Nottingham D365/CRM user group Chapter Leader TDG – Community leader Twitter @charlied3v LinedIn

Leave a Reply