A Basic Bot using Azure Bot Services

I wanted to break out my comfort levels and do something different from Azure SQL Database or straight SQL Server. I really did try something new and created a Chat Bot using Azure’s Bot Service. Warning: I am a DBA by day (and night) so this is a fun post where I am trying out different areas of Azure so I apologise if you find this too basic – its Christmas lets have some fun!

It is split across two parts. First you have to create a knowledge base which I did via the QnA Maker tool. Then secondly you use this knowledge base and link it to your Azure Bot Service.

The knowledge Base

Go to www.qnamaker.ai

QnA

Click My Services and you will need to enter in your Microsoft Account.

MSACCOUNT

You will be presented with the welcome page.

QnAMaker

So what I did at this stage is upload a word document which had my conversation.

This is an example:

Q. Why are you so expensive? A. We are market leaders that’s why! (you get my point)

You have the ability to build inputs based on a word and should probably use synonyms of that word, for example the word HELLO = Hi/Howdy/Hey etc. That’s what I did anyways.

ArunBots

Next is the document upload.

UploadQ

The application will try to divide and understand your text into question and answers, if you think it has not correctly understood your conversation you can easily edit it here. Once you are happy you can test it.

TestBot

Here is an interactive test.

InteractiveTest

Make changes via a  “Save and Retrain” else publish it.

publish

deplyed

Build the Bot Service

The next phase is to create the bot service. Naturally you need to login to the Azure Portal and then find the bot service.

BotPreview

Pretty straightforward so far.

createPlan

In terms of template I selected the Q&A one.

qaform

During this stage we have to create a password and use it to authenticate the bot framework. You start this process by clicking on the create a Microsoft App ID button.

appID

The password above should be pasted into the below screen.

CREATEBOT

Hit that important create bot button and it will link it to the knowledgebase created earlier on.

DEPLOYbot

Next click the channels option.

channels

webchat.JPG

I used the webchat channel where I take the URL (Not shown below but it is shown after the secret key section) and append the secret to it.

Simply its https://(URL +SECRET)

secretKey.JPG

Paste it into your web browser and give it a go. Here is my webchat with my Bot. Enjoy!

TheChat

The portal is amazing the stats available to you are well tracked and to be honest it is what I expect from the Azure.

metricAzure

I absolutely love the process explorer view too.

PID

Drill down is possible by clicking on the PID.

piddrilldown

By the way updating the knowledgebase and re-publishing even at this stage does update the bot service with no additional tweaking which is cool!

If you did not enjoy this post then I apologise and make no mistake I will be going back to Database related topics in the future.

Thanks for reading – Have a great holiday break.

 

 

1 thought on “A Basic Bot using Azure Bot Services

  1. Pingback: Dew Drop - December 20, 2017 (#2628) - Morning Dew

Leave a Reply