/ Azure

Azure Bot Service - Creating your first Bot

There have been a lot of Microsoft announcements over the past week, so you will have been forgiven for missing the news about the Azure Bot Service. Azure Bot Service brings together Azure Functions and the Microsoft Bot Framework. When I say it brings together these two services - I mean it.

I first tried the Bot Framework upon release in March at Build 2016. However, the experience of creating a bot was not seamless. You had to provision your Azure infrastructure to run the Bot, set up a myriad of API keys for your Application, Bot, Channels, LUIS API and more. Azure Bot Service completely changes that experience, and I mean that. Let's take a look.

Firstly, load up the Azure Portal, using your usual account credentials.

Load up the Azure Portal and find Azure Bot Service

Once you are in, use the navigation bar and search for "Azure Bot Service". Scroll across and select "Azure Bot Service" from the list of available services. Then click create on the resulting blade.

Click create on the Azure Bot Service Blade

You are presented with a form to set up the underlying infrastructure of your bot (similar to the input for an Azure App Service instance). Input an appropriate App name, Resource Group name and Location.

Input configuration details for your Azure Bot Service

After a few minutes, you will receive a Deployment succeeded notification in the Azure portal. View your newly created resource. Once clicking into the Bot Service, you see another form, with two sections. The first part focuses the Microsoft App ID, to authenticate your bot with the Bot Framework. You will need to click the blue "Create Microsoft App ID and password" button.

Azure Bot Service - Create a Microsoft App ID Step 1

You should now see a different screen, similar to the below. You will need to

  • Copy the App ID to the App ID input box in the Azure Portal
  • Click on the "Generate an app password to continue" button, which will present a popup. Copy the resulting password into the password input box in the Azure Portal.

Azure Bot Service - Create a Microsoft App ID Step 2

You will now notice that the latter part of the form has activated. Select your desired language out of C# and NodeJS (There is excellent documentation for both, here and here respectively).

There are four boilerplate options to get you started; Basic, Form, Proactive and Language understanding. You will likely use a combination of these approaches, as you build our your bot. For demonstration purposes, we are going to create a "Language understanding" bot. Selecting this option allows us to use LUIS (Language Understanding Intelligence Service), one of the Cognitive Services APIs to understand intent from user input.

Azure Bot Service - Create a Microsoft App ID Step 2

If you have selected the Language understanding template, you will now see a popup box, like the one shown below. You will need to enter a set of credentials to create a model using LUIS. This service is your bot's brain - the set of inputs that it has recorded against users, along with intents that the bot can perform. As you create the bot, you will use the LUIS portal to assign the user inputs to the most appropriate intent, helping train your model (or bot's brain), as a supervised learning exercise.

Azure Bot Service - Connect to LUIS

Once you have entered your details and confirmed access for the LUIS API, you will see that the Bot Service has begun scaffolding your initial bot template.

Azure Bot Service - Generating your bot

Congratulations, you have just created your first bot! As I mentioned earlier, this experience is an incredible improvement over steps that you originally had to take to setup a bot - The team have done a magnificent job.

But it doesn't end there, take a look at the screenshot below - You can see that the code has already been setup within an Azure Function, with an emulator set up directly within the same view.

Azure Bot Service - Congratulations, here is your bot!

Selecting the "Channels" tab at the top of the page will present you the list of channels in which the bot is currently active. The beauty of the Bot Framework is that you can write the bot logic once, and expand the Bot's reach to multiple channels by changing the configuration within this portal.

Azure Bot Service - Channels Tab

Once you move along to the "Settings" tab, you will be able to configure the name of your bot (as it would appear in the public bot directory), as well as the associated description.

You can also manage your continuous integration pipeline, in addition to advanced settings, relating to the underlying app service. Let's talk about continuous integration another time. In case you hadn't realised it already from some of my other blog posts, cloud governance is a topic close to my heart!

Azure Bot Service - Settings Tab

Finally, clicking on the "Publish" tab, you will see some settings that relate to the publicly displayed information in the Bot Portal, relating to you as the publisher.

Azure Bot Service - Settings Tab

This blog has been a whistle-stop tour, walking you through the setup of a bot using the new Azure Bot Service. I would highly recommend that you take a look through the official documentation on Azure Bot Service.

I think that Bots are a fascinating evolution in how we interact with computers. Rather than clicking/tapping an application, if implemented in the right way, we can naturally converse with a Bot to perform our desired intent. I am sure that this will be the first of many blog posts from me on Azure Bot Service and the Bot Framework.

Please let me know your thoughts on Twitter @reddobowen, I would love to hear what Bot ideas you come up with, and implement!

Christian Reddington

Christian Reddington

Christian is enthusiastic about using technology to empower people and organisations. His current areas of interest include the Internet of Things, Data Science and DevOps.

Read More
Azure Bot Service - Creating your first Bot
Share this