Son 04 Juni 2017
| tags: chat bot azure
Introduction
In conjunction with a public referendum I was given the task to create an intelligent chat bot. The chat bot could understand what the user wanted to know and provide the answers our subject matter experts had prepared. This post describes you can give users access to the bot by hosting it at a web service. It also describes how to add more developers to the project. The post assumes that you have already read the first post and second post on this topic.
Hosting the bot
All the prior work would be in vain if we did not give our users a way to interact with the bot. Luckily, this is the easiest step in creating a chat bot, and where the strengths of the Microsof Bot Framework are are real advantaged. To set up some communication channels, log in at https://dev.botframework.com and select the bot in question under the “My Bots” tab.
Here you see active channels and you can add others as well, for example Facebook Messenger. Having an easy way to deploy the same bot in multiple channels removes a lot of duplicate work. Very convenient! Getting the bot to work with Skype is simple, just follow the instructions, add the bot as a Skype contact and start chatting with your bot.
Web Chat channel
Let’s set up the Web Chat! Click on “Edit” and it will give this page:
Generate a secret key and replace the “YOUR_SECRET_HERE” with the generated key. All you need to do is to add that iframe line to a webpage and a chat window should magically appear on the page. Web design is outside the scope of this blog, so you probably should look for documentation elsewhere, or hand the iframe code snippet to your online customer relations team. The page where you decide to host it can be any page connected to the Internet, for example a public corporate page or a privately hosted website.
Hosting as a Web Chat on an Azure
You can of course also host the webpage containing the bot on Azure. If you want to host it on Azure you can create a new App Service in the portal and configure it as you deem appropriate, taking expected traffic into account. The web app will be available at http://[web app name].azurewebsites.net.
You should now have a place to host the bot, but you are not yet telling your new Azure website what it should show the world. To add the html file containing the chat window to this new site you can access the cloud folder structure using the FTP username and hostname that the Azure portal provides (see screenshot above). If you are using Ubuntu like me, you can access this directly with the “Files” program, no third party tools necessary. If not a search engine should help you find a suitable tool without much problem. Once you have opened the remote folder, please put the html file in site/wwwroot/
. You should be able to access the page from the url that you specified when creating the app service, e.g., http://[web app name].azurewebsites.net/[page name].html
.
Add more contributors
It is possible to add more contributors to your bot if they are in the same Azure Active Directory. To do so head over to https://dev.botframework.com , select your bot and click “Edit” in the “Details” box.
At the bottom of this page you will find an “Admin” box. Additional admins can be added if they are separated by “,” without any adjacent spaces.
For LUIS however, we are not so lucky. By the time I set up LUIS it was not possible to have more than one person contributing to the Language Understanding. I discussed this with Microsoft directly who mentioned that I was not the first person requesting this feature, so this situation could change. To circumvent this limitation we resorted to create a joint email account which we used for configuring LUIS.
Summary
In this post we have seen how we can make the bot available to users through many different channels, a process made easier by using the Microsoft Bot Framework. A concrete example on how to integrate the bot with a web page and host it on Azure was given. Finally, the post provided some help on how to add more developers to the project.
If you have comments, questions or suggestions please leave a note below!
comments