Azure Web App Bot with QnA Maker

Azure Bot Service provides the core components for creating bots, including the Bot Framework SDK for developing bots and the bot service for connecting bots to channels.

We are can create the bot in 2 ways.

1. Create Web App Bot in Azure portal, download the source code and develop the bot locally.

This approach would need coding skills.

2. Use QnA Maker or Luis for creating the bot.

This approach doesn’t need coding skills.

I chose Azure data store selection as my use case for the bot. I see that a bot can address many use cases within the organization. E.g., we can maintain security standard details of all Azure databases in single knowledge base and the app users can find out about them by interacting with the bot.

For my first use case, I haven’t chosen Luis which provides the ability to understand what your user means conversationally and contextually, but went with QnA Maker which provides a conversational question and answer layer over your data.

Steps involved in setting up a bot using QnA Maker are

1. Create a QnA service

2. Create a knowledge base (KB)

3. Edit, test and publish the knowledge base (KB)

4. Create Azure Web App Bot

5. Test the bot in Web Chat

6. Connect the bot to channels

Step 1: Create a QnA service

Open qnamaker.ai and login using a Microsoft account.

Go to “Create a knowledge base” tab and press “Create a QnA service” button.

Step 2: Create a knowledge base (KB)

Once the QnAMaker service is created in Azure, connect that to the KB, and name the KB.

Then, press “Create your KB” button.

Once the KB is created, go to “My knowledge bases” tab, and there you can see the KB created.

Step 3: Edit, test and publish the knowledge base (KB)

a. Edit the KB

Add all the QnA pairs that’s needed for the bot.

Once the QnA pairs are added, save them and test them.

c. Once satisfied with the testing results, publish the KB.

Step 4: Create Azure Web App Bot

Press “Create bot” button (found in the above screenshot).

Step 5: Test the bot in Web Chat

Step 6: Connect the bot to channels

Azure provides many channel options. Details are provided about how to integrate with any chosen channel.

For my use case, I decided to run the bot on Web app.

For this to work, these are needed.

a. Get bot embed codes

b. Create a new app service in Azure portal.

Once it’s created, go to App Service Editor.

c. Copy the embed code along with the secret key in the editor and test the bot.

Now we can run the bot from any browser.

Disclaimer: The posts here represent my personal views and not those of my employer or any specific vendor. Any technical advice or instructions are based on my own personal knowledge and experience.

--

--