Do-It-Yourself FAQ Bot

Chloe Condon
Jul 1 · 9 min read
  • Bootcamp grads seeking career advice 🙋‍♀️
  • Speaking inquires 🎤
  • Ongoing conversations with close friends 👯‍♀️
  • Creepy folks (bots?) I’ve never met just saying “hey” 🙅🏼‍♀️
  • Miscellaneous opportunities (podcasts, interviews, specific Furby hacking questions, etc). 🎧🎙🎭❓

Let’s Create a Knowledge Base & QnA Service!

First, head to the QnA Portal (https://www.qnamaker.ai/) and sign-in in the right corner with your Azure credentials. Click over to to Create a Knowledge Base (https://www.qnamaker.ai/Create).

Let’s Provide QnA Maker Service Details!

Next, we’ll need to provide some details for the QnA Maker, including a unique name, Azure subscription, location, etc. Pictured below are my inputs. You’ll notice I’ve selected F0 for pricing (free tier) and have chosen West Coast (closest to my current location) for all locations. I’ve also created a new resource group called ChloBots (you can name yours whatever you’d like). For pricing tier, I’ve selected F (three indexes) which is the free tier for the search pricing tier. I have also disabled App Insights for this demo, but enabling is also an option if you’d like to have monitoring data (you can learn more about that here).

Let’s Connect Our QnA Maker Service to the Knowledge Base!

Head back to the QnA Maker web portal. If you refresh the page, dropdown menus showing your account info will show up under Step 2. Select the Directory ID, subscription name, and QnA service (the ones we just selected/created in the Azure portal).

Populate Knowledge Base

Download this Word doc of FAQs I’ve created (obviously, you can create your own set of FAQs or edit this file to customize it for your own bot). Under step 4, add the file in QnAMaker.

Let’s Test it Out!

Believe it or not, our bot is already ready to test (told ya it was witchcraft 🔮)! In the top right corner, click Test and you can go ahead and test out your bot! Go ahead and ask it some commonly asked questions, and see its responses.

Let’s Publish Our Knowledge Base!

Once you’ve tested out your bot and you are confident in it’s answers, we can go ahead and publish our knowledge base!

Let’s Integrate!

In the Azure portal, click on Create a Resource on the lefthand side of the page. In the search bar enter “bot”, and find Web App Bot. We’ll now create a web site for our bot, and we’ll also get it registered with Azure Bot Service. This looks similar to the QnA Maker Service we created earlier, but with a few minor adjustments. Provide a name (this must be unique!) for your bot (I’m naming mine “chloebootcampbot”), and select your subscription and the resource group you used/created previously. Use S1 pricing tier, and under Bot Template select SDK v3 and C# for language as well as Question and Answer for the template.

Let’s Connect Our Bot to Our QnA Service!

Here’s the part where we connect it all together 🤖 If you don’t already have it open, create a new tab to sign into your QnA Maker account and find the details for your QnA Maker service that was published. In the Postman sample, find the GUID (this represents the knowledge base ID) and copy it. We’ll paste that GUID and select the Hidden Value for QnAKnowledgebaseId in our Application Settings.

Let’s Connect it to Twilio!

Now we’ll need to connect it to the proper Channel. I’ve decided to use Twilio for this, since I’m familiar with their API. If you’re unfamiliar, Twilio allows software developers to programmatically make and receive phone calls, send and receive text messages, and perform other communication functions using its web service APIs. Head over to Twilio, and set-up an account if you don’t have one already (🙋‍♀️ FYI you can use code CHLOE20 for some free credits). You can use Twilio in all kinds of ways (fake boyfriend apps and ADHD reminders to name a few 🤳)!

Let’s Create a TwiML App!

Now we need to create a TwiML app so we can give it a Request URL (in this case, https://sms.botframework.com/api/sms) for messaging with Twilio. In the Twilio console click through to Programmable Messaging > Tools > TwiML Apps. Click the red ➕ sign icon, or Create new TwiML App.

Microsoft Azure

Any language. Any platform. Our team is focused on making the world more amazing for developers and IT operations communities with the best that Microsoft Azure can provide. If you want to contribute in this journey with us, contact us at medium@microsoft.com

Chloe Condon

Written by

Musical theatre actress turned developer evangelist.

Microsoft Azure

Any language. Any platform. Our team is focused on making the world more amazing for developers and IT operations communities with the best that Microsoft Azure can provide. If you want to contribute in this journey with us, contact us at medium@microsoft.com