Deploying Your Bot to the Cloud

In Artificial Intelligence by Christian HissibiniLeave a Comment

Introduction

In this walkthrough you will learn how to register your bot and deploy it to Azure so others can use it.

Prerequisites

The following software is required for completing this exercise:

Task 1: Register the Bot with the Bot Framework

In this task you will generate an App ID and App Password, and register your bot.

  1. Sign in to the Bot Framework Portal.
  2. Click the My bots button and next click the Create a bot button (if you have other bots) or the Register buton.
  3. Upload the logo.png as Custom Icon.
  4. Type Help Desk Bot as Display Name. Enter a globally unique App Name in the Bot Handle.
  5. For Long Description you can enter This bot will try to help you to solve common issues and can raise tricky ones as tickets. This is the description that will appear in search results, so it should accurately describe what the bot does.
  6. On the Configuration section, click on the Create Microsoft AppID and Password button and a new page should open. If required, sign in again with the same credentials you use in the Bot Framework portal. In this page, you should see the App name you have entered previously and an App ID which was automatically generated. Save the App ID for later and click on the Generate an app password to continue.
  7. You should see a popup which contains an automatically generated password for your bot. Notice that this is the only time it will be displayed. Store it securely for later. Click Ok to close the popup.
  8. Click on the Finish and go back to Bot Framework button. You may notice the page will close and you will go back to the Bot registration page. Now, you have the App ID displayed in the page.
  9. Scroll down and confirm your agreement of the Terms of Use, Privacy Statement, and Code of Conduct. Click on the Register button. A confirmation message should appear, click Ok. And next you should see your bot’s dashboard with a few channels available.

Task 2: Publish your Bot to Azure

In this task you will learn how to publish your bot to Azure from Visual Studio.

  1. Open the solution you’ve obtained from the previous exercise. Alternatively, you can open the solution file from the exercise4-KnowledgeBase folder. If you do so, in Dialogs\RootDialog.cs replace the [LuisModel(“{LUISAppID}”, “{LUISKey}”)] attribute placeholders with your own LUIS App Id and Programmatic API Key (as explained in exercise 3).
  2. Go to the Build menu and there click Publish HelpDeskBot (or how you’ve called your project). In the window that opens, select Microsoft Azure App ServiceCreate New and click Publish.
  3. A new window should open. Enter an App name, choose a Subscription and a Resource Group. You can use the same resource group you’ve used for the Cosmos DB and Search services.
  4. Click on the Create button. Next the deployment will start creating the Web App in your subscription. When finished, your default web browser will open redirecting to your bot URL.

Task 3: Configure the Azure Web App

In this task you will learn how to configure your app to enable it to communicate with the Bot framework channels.

  1. Sign in to the Azure portal.
  2. Open the previously created App Service. Click on Application Settings on the left menu. Navigate to the App settings and add the following keys and replace with the values described (you should have these values in your bot source code).KeyDescriptionAzureSearchAccountUse the Azure Search account nameAzureSearchIndexUse the Azure Search index nameAzureSearchKeyUse the Azure Search keyMicrosoftAppIdUse the Bot App IDMicrosoftAppPasswordUse the Bot PasswordTicketsAPIBaseUrlUse your App Service URL (eg. https://help-desk-bot.azurewebsites.net/)After you entered the key and values you should have a similar result as the image below.
  3. Click Save ().

Task 4: Update Your Bot Configuration

  1. Navigate to Bot Framework Portal. Click on your bot name to edit it.
  2. Click on the Settings button on the top-right corner of the page.
  3. On the Configuration section, type the App Service URL you created on Task 2 (eg. https://help-desk-bot.azurewebsites.net/api/messages). Remember to put the /api/messages at the end of the URL and ensure the protocol is https. Click the Save changes button at the bottom of the page.

Task 5: Test Your Published Bot

In this task you will test your bot from other channels.

  1. Click on the Test button on the top-right corner of the page. It should open a new window on the right of the page. This is an embedded Web Chat Channel so you can easily test your bot.
  2. Type Hi! I want to explore the knowledge base and see the bot response with the category list. Click on any of the category and see the articles listed for that category and click on one article to see it.
  3. Click the Channels menu item. Notice you should have the Skype and Web Chat channels enabled by default. Click on the Skype link. A new page will open to allow to add your bot to your Skype account. Click on the Add to Contactsbutton. You should be prompted to be sign into your Skype Account and the Skype app should be opened.NOTE: You can also check the Get bot embed codes link that shows you how to build a link for users to add the bot to their Skype account.
  4. Search for the bot on your Contact List and test a new conversation.NOTE: At the moment this hands-on lab was written Skype does not fully support Adaptive Cards, so you might not see the ticket confirmation message correctly.

Leave a Comment