1. Home
  2. Training Library
  3. Microsoft Azure
  4. Courses
  5. Creating a Bot Using Microsoft Bot Framework Composer

Deploying a Chatbot to Azure from Composer

Start course

This course shows you the fundamentals of how to create, test, troubleshoot, and publish chatbots using the Microsoft Bot Framework Composer. You’ll learn about dialogs, triggers, and prompts and how these can be used to model conversational logic in your chatbots. We'll cover how to work with state and variables before moving on to how to control chatbot output by using language generation and how to implement adaptive cards to create rich user experiences.

Then we'll explore how the Bot Framework Emulator, Webchat Window, Watch Window, and Application Insights can be used to debug your chatbot. Finally, we'll show you how to get your chatbot published on Azure and how to test your chatbot using the Azure Portal.

Learning Objectives

  • Use Bot Framework Composer to create chatbots
  • Implement dialogs and maintain state
  • Implement logging for a bot conversation
  • Implement prompts for user input
  • Troubleshoot a conversational bot
  • Add language generation for a response
  • Design and implement adaptive cards
  • Test and publish a chatbot 

Intended Audience

This course is intended for developers or software architects who want to learn more about Bot Framework Composer and how it can be used to create conversational AI solutions in Microsoft Azure. 


To get the most out of this course, you should have:

  • Intermediate knowledge of coding techniques
  • Familiarity with Azure concepts such as App Service and resources
  • An understanding of JSON

Let's look at the available options you can use to deploy your chatbot using Bot Framework Composer. In this lecture, we will learn about the available options you have for deploying chatbots. We'll look at how you can use Composer to automatically create Azure resources for your chatbot. We'll see how you can import existing Azure resources for your chatbot. You'll also learn how to manually configure chatbot resources by using the handoff to admin feature in Composer. And finally, we'll see a demo of publishing a chatbot to Azure, and how you can quickly test this.

There are three main ways you can publish a chatbot. You can get Composer to automatically provision the required Azure resources for your chatbots. You can choose to import existing Azure resources, or you can hand off control to your Azure administrator to manually set up resources. We'll take a closer look at each of these now. Let's look at how Composer can save you time by automatically provisioning all required chatbot's resources in Azure. The main steps involved to help get your chatbot's resources automatically provisioned in Azure from Bot Framework Composer includes creating a published profile for the chatbot, ensuring you're signed into your Azure account from Bot Framework Composer, specifying the Azure subscription and name for the new resources.

Creating the published profile is straightforward. You supply a profile name and set the publishing target. At the time of this course, Composer only supports a publishing target of Azure. Moving on to the next part of the published profile process, is where you tell Composer that you want to automatically provision resources. You do this by selecting the create new resources option. The final step involves selecting the Azure subscription. You also need to specify a resource group for your chatbot's resources. You can choose to deploy to an existing resource group or to create a new resource group. After specifying the operating system, you tell Composer the name you'd like to assign to your resource.

Finally, you can also specify the region for the a natural language processing capability LUIS. In the past, I've had permission and authentication issues when hosting the chatbot in LUIS in different regions, so I normally use the same region for both. After supplying the details we've just looked at, Bot Framework Composer will generate a Microsoft application registration, an app service to host the bot, and a bot channel registration. Each of these form the minimal set of core resources needed to get your chatbots running in Azure.

Bot Framework Composer can also automatically provision Azure Cosmos DB storage, application insights for error logging, or the NLP service LUIS. These are optional resources, and the decision to automate the creation of these depends entirely on your use case. I personally tend to create the LUIS resource directly by visiting the site luis.ai and manually configuring the required settings. This is just a personal preference, and introducing another option you have in terms of publishing your chatbot.

Let's look at how you can import existing resources in Bot Framework Composer. To import and reuse existing Azure resources for use with your chatbot, you'll need full access to all resources. Doing this involves using various values from JSON settings from the relevant and existing services that you want to import. And you'll typically extract these settings from multiple files or resources within Azure. Some resources you might choose to import when publishing your chatbot can include, but are not limited to, the Microsoft application registration, the bot channel registration, the NLP service LUIS, the machine learning service, Microsoft QnA Maker, or Azure Blob Storage.

When you've identified existing resources in Azure that you want to implement, you need to manually update these and the related settings in the publish configuration for your chatbot. Be careful when amending this file, and remove nodes that you aren't importing. This brings us on to the final option you can use to publish your chatbot, hand off to admin. The hand off to admin feature is a useful option to consider if users may not have sufficient privileges in Azure, or if users may not feel comfortable enough creating resources in Azure.

Admin hand off is also a good way to enforce any governance for chatbot deployments to your cloud infrastructure and resources in Azure. Hand off to admin involves two steps. In the first step, the user selects the hand off to admin step and selects the required resources. Bot Framework Composer will then automatically generate the required instructions and commands for the Azure admin to run. We can see an example of the instructions being generated by Bot Framework Composer here. In step two of the handoff process, the admin provisions the required resources in Azure and exports the relevant JSON settings. The Bot Framework Composer import existing resources feature can then be used to configure the chatbot with the resources the Azure admin set up.

One thing to call out when publishing chatbots that are using the NLP service LUIS, is to remember to author and publish your LUIS application to the same region. You can find out more about LUIS authoring and publishing regions at the URL in this slide. It's now time for a demo. In this demo, we'll see how to publish a chatbot from Bot Framework Composer to Microsoft Azure. We'll also see how you can quickly test the chatbot using the test web chat feature in the Azure portal.

So here we can see we have a chatbot open in Bot Framework Composer. The chatbot that we're looking at is a calculator bot from the earlier lecture. We want to host this chatbot in Azure. We can do this by clicking on the publish icon. We don't have a published profile or target for this chatbot, so we need to create one. We can do this by selecting the chatbot, and then clicking on the dropdown list. We select add new. To create the published profile, we also have to supply a name and publishing target. We click on next.

When asked which resources we want to create in Azure, we'll keep the default and tell Composer to create new resources. We then click on next. Here we need to tell Composer which Azure subscription and resource group to create. We provide the Azure subscription. We'll create a new resource group. We'll keep the default operating system as Windows, and we'll supply a name for the chatbot. We'll select the region. Then we click on next. When prompted if we want to create additional resources, we'll remove the optional items. We then click on next.

In this final step of the process, we can review the resources Composer will create for us. We only want Composer to create the core resources so the items that we can see here look good. We'll click on create, and Composer will publish the chatbots and provision the resources in Azure. With the chatbots now published in Azure, we can test it directly in the Azure portal. So here, we're in the Azure portal. We're looking at the resource group that our chatbot was deployed to from Composer. We can see the three core resources that were automatically created by Composer.

The Azure bot, the app service plan, and the app service. The resource of type Azure bot is our actual chatbot resource. We can interact with this by selecting the chatbot. Selecting the testing web chat link displays a window that lets you interact with the chatbot. A test web chat window is displayed in the Azure portal. After a few moments, the chatbot springs to life. We can interact with it like before. We can supply a first number, followed by the second number. We can also select the operation, and the correct answer is returned.

In this demo, we've seen how to deploy a chatbot from Bot Framework Composer. We've also seen how to quickly test your chatbot in Microsoft Azure.

About the Author
Jamie Maguire
Software Architect, Developer, and Microsoft MVP (AI)

Jamie Maguire is a Software Architect, Developer, Microsoft MVP (AI), and lifelong tech enthusiast with over 20 years of professional experience.

Jamie is passionate about using AI technologies to help advance systems in a wide range of organizations. 

He has collaborated on many projects including working with Twitter, National Geographic, and the University of Michigan. Jamie is a keen contributor to the technology community and has gained global recognition for articles he has written and software he has built. 

He is a STEM Ambassador and Code Club volunteer, inspiring interest at grassroots level. Jamie shares his story and expertise at speaking events, on social media, and through podcast interviews. 

He has co-authored a book with 16 fellow MVPs demonstrating how Microsoft AI can be used in the real world and regularly publishes material to encourage and promote the use of AI and .NET technologies.