Creating a Chatbot on Azure
The course is part of these learning paths
The ‘Building a Chatbot on Azure’ course will allow team members to learn how to automate basic support tasks by using chatbots to answer typical questions about their products and/or services.
In this course, you will learn how to create a chatbot to answer support questions about specific products and services. Along with this, you will learn how to combine the Azure Bot Service and Azure QnA Maker and to add speech input and output capabilities to help customers on mobile devices and those with impaired sight.
This course is made up of 5 lectures that will require some previous knowledge of Azure and coding.
- Create and configure an Azure QnA Maker knowledge base
- Create an Azure Bot Service chatbot that answers questions
- Enable speech recognition and synthesis on an Azure chatbot
- Those interested in artificial intelligence services on Azure, especially chatbots
- Previous experience using Azure
- Previous experience with writing code
The GitHub repository for this course is at https://github.com/cloudacademy/azure-chatbot.
Now that our knowledge base is ready, let’s create a bot that uses it. Click “Create a resource” and search for “Bot Services”. There are three choices. We want a “Web App Bot”. Click “Create”.
The name has to be globally unique and “qnabot” is already taken, so I’ll call mine “ca” (for Cloud Academy) “qnabot”. You’ll have to use a different name.
I’m going to change the location to “West US” so it’s in the same location as the QnA service I created. They don’t have to be in the same location, but it’s usually a good idea to keep services together for performance reasons. Change the pricing to the free tier.
This part is really important. Click on “Bot template”, choose Question and Answer”, and click the “Select” button. If you don’t choose this template, then you won’t be able to connect with the QnA service.
For the app service plan, I’m going to choose the one I created for “qnaforbot”. You don’t have to do that, but I’m going to put them on the same plan. And I’m going to turn off “Application Insights” again.
This is for registering the app in Azure Active Directory for authentication purposes. Leave it on “Auto create App ID and password” so you don’t have to do it manually.
Finally, click “Create”. It’ll take a while to finish, so I’ll fast forward. OK, it’s done, so click “Go to resource”. Whoops, I just missed it, so I’ll go to the notifications and do it from there.
If you click “Test in Web Chat”, you can try out the bot. Type something here. It tells us that we need to configure some settings. That’s because it doesn’t know where our QnA knowledge base is. So click on “Application Settings” and scroll down to the “Application settings” section. The ones we need to set all start with “QnA”.
Remember when I mentioned that you need to leave the browser tab open after creating the bot? Well, this is the time when we need it, so go back to that tab. If it’s not still open, then go back to qnamaker.ai, click on “My knowledge bases”, and click “View Code”.
Copy the authorization key from here and paste it next to “QnAAuthKey”. Then copy the whole URL next to “Host” and paste it next to “QnAEndpointHostName”. Finally, copy this ID here and paste it next to “QnAKnowledgebaseId”. Then click “Save”.
Now if we go back to “Test in Web Chat”, we should be able to get answers from the knowledge base. Type “languages supported” again and see what happens. Great, it came back with the answer.
In the next lesson, I’ll show you how to create a user-facing chat app, so if you’re ready, then go to the next video.
Guy launched his first training website in 1995 and he's been helping people learn IT technologies ever since. He has been a sysadmin, instructor, sales engineer, IT manager, and entrepreneur. In his most recent venture, he founded and led a cloud-based training infrastructure company that provided virtual labs for some of the largest software vendors in the world. Guy’s passion is making complex technology easy to understand. His activities outside of work have included riding an elephant and skydiving (although not at the same time).