Given That, Then… — Building a QnA-style Chatbot, Part 2
| January 26, 2021 | in
In the first part of this series, we created a knowledge base for our chatbot. Now it’s time to consume that knowledge base.
When we’re done, the chatbot can be hosted on a variety of solutions and ways. For example, we could embed it within Microsoft Teams, GroupMe, or Facebook. But for now, we will just publish it to the web using an iframe.
Microsoft created a diagram that shows how all the chatbot pieces play together. The secret sauce of Microsoft’s QnA maker app we used in our previous post sets up all the knowledge base analysis for you.
Once you have a knowledge base, you can create a chatbot. Again, Azure makes this somewhat easy as they give you a single button in the UI to do this.
This will create a “Web App Bot” for you. This is shown as two separate resources in your Azure Portal: the bot and a standard app service. It appears as the bot is just another way of looking at the app service. The “Web App Bot” exposes specific configuration and settings for a “Bot,” but ultimately behind the scenes there is just another app service running.
Once the Web App Bot is created, you can go to that resource in the Azure Portal where you can do things such as:
- Download the source code for that bot (starter code for your bot)
- Configure API Keys and configuration (you shouldn’t need to change this)
- Configure embed code
Once your bot is configured, you can get your embed code from within the Azure Portal too. To get your embed code, navigate the Channels blade, and then click the “Get the embed code” link. This will get you an embed code that uses an iframe solution. Microsoft has a GitHub project that shows many examples of integrating the chatbot with various technologies such as React or Angular.
You have quite a few services running after you have the chatbot in place, but most of them can be configured by wizards.
Setting up a QnA chatbot in Azure is pretty simple if you don’t overthink it. It is easy to get lost in the many services and pieces created by Azure along the way. If you know where to go and what to configure, it isn’t that bad. I feel the UI / process for this could be streamlined quite a bit, but I also realize that this process would be almost overwhelming for all but a real expert without the current help of the QnA chatbot maker.