Compartir a través de


Create a Bot using an Azure App Service Bot Service

This article has been moved to its new home here: https://benperk.github.io/msdn/2016/2016-11-create-a-bot-using-an-azure-app-service-bot-service.html

I am so excited about Bots (#Bot) that I can barely control myself.  My hands are literally shaking as I write this post.  I wrote this post a few months ago that discuses how I got started using the Bot Framework (#BotFramework) with LUIS, it was a little complicated but now with the built in Azure capabilities and the Bot as a Server (BaaS) concept, it is quick and easy to get started.

This is how I did it:

  • Create a new Bot Service from within the Azure Portal here
  • Setup a Microsoft App Id and add the credentials
  • Select the language and template, create the bot
  • Test it, look at LUIS

Here are some other more recent articles I have written on this subject:

Create a new Bot Service

Log into the Azure Portal, click on the + New, then search for Bot Service, as shown in Figure 1.

image

Figure 1, create a bot in the Azure Portal, quick easy

Enter the required details for the bot, they are identical to the required details of an App Service, for example App Name, Subscription, Resource Group and Location.  Once entered, similar to that in Figure 2, click the Create button.

image

Figure 2, create a bot in azure using bot services

Once created/deployed, navigate to the Bot by clicking on the link either from the main page, if you pinned it to the dashboard or open the resource group and click the link.

Setup a Microsoft App Id and add the credentials

You will be prompted to create a Microsoft App Id, like that in Figure 3.  Click the button and capture the App Id and Password.

image

Figure 3, create a bot and the associated Microsoft app id

Enter the credentials into the text boxes and then select the language and template, I chose the Language understanding  template as I want to use LUIS later.

Finally, click on the Create bot button and the bot gets created, as shown in Figure 4.  I did receive an Internal Server Error during the creation and it took some minutes for that to happen.  Most likely the request is asynchronous to LUIS and it times out.  I just closed down the blade and came back to it.  It worked fine from that point.  I am sure they are working on fixing that as this is feature is only a few days old.

image

Figure 4, create a bot as a service (#BaaS) in Microsoft Azure #chatbot

Test it, look at LUIS

By default there are two LUIS intents, None and MyIntent.  I tested them by entering in ‘None’ and ‘MyIntent’ and as you can see in Figure 5, the message which is associated to that intent is rendered back to the Chat window.  Now I just need to make my Chat logic more intelligent, and I can do it right in the portal, no more Visual Studio project at all.  So awesome!

image

Figure 5, successful test of the bot service in Azure

Now I can login to LUIS here and add more intents and train my AI to answer more questions.  The creation of the Bot using the Language understanding creates a a LUIS application similar to that shown in Figure 6.

image

Figure 6, the LUIS application create by default from bot service in Azure

Now it’s time to rock!  #AI #ArtificialIntelligence #Cognitive #BotServices #Azure

Comments

  • Anonymous
    November 21, 2016
    Hi, thanks much for detailed steps to get started for creating bot. Do you plan to add steps as how this bot will be accessed outside of Microsoft Azure portal. I am newbie in this space and trying out the stuff.
    • Anonymous
      November 22, 2016
      Yes, I will write a few more posts on this topic. Check the Popular Tags section on the right and click the Bot or LUIS tags. Very happy you like this, I like it too.
  • Anonymous
    November 23, 2016
    If I already have an existing azure app service running , how do I migrate it to the bot service?
    • Anonymous
      November 29, 2016
      AFAIK you cannot. Bot Services run on the Dynamic plan (server-less computing) while App Services run on something like Standard, Basic, Premium, etc... There is nothing wrong with leaving you bot running on an App Service.
    • Anonymous
      November 30, 2016
      @Vivek AFAIK you cannot, at least right now. An app service runs on standard, basic, premium plans, while the bot service runs on the dynamic plan (server less computing). Also, when you code your Bot Service they are csx (C# Script) files and not cs files any longer. I find that it is ok to run your bot from an app service, at the moment both work just fine. HTH
  • Anonymous
    March 29, 2017
    Hey!Nice and detailed description. It really helped me understanding how to program the behaviour of my bot. Unfortunately Microsoft has made some major updated over the past months.. I especially struggle with connecting my on-premise code, with my registered bot on https://dev.botframework.com/ AND using LUIS with this. Do you happen to know some good tutorial which could point me into the right direction?
  • Anonymous
    October 15, 2017
    hi team,Can you please tell what to put under "App Name" here. Is it something we need to create in advance or any name we can give? Can you please suggests. I tried a lot i am not able to move as app name is incorrect.
    • Anonymous
      October 16, 2017
      @Ketan, yes, App Name is something you will need to create before moving forward and it needs to be unique, you cannot use the one I show in Figure 2.