Create an Azure Bot resource

APPLIES TO: SDK v4

The Azure Bot resource (bot resource) allows you to register your bot with Azure Bot Services and to connect your bot to channels. You can build, connect, and manage bots to interact with your users wherever they are, from your app or website to Teams, Messenger and many other channels. To learn how to create a bot, see the Create a bot with the Bot Framework SDK quickstart.

This article describes how to create a bot resource through the Azure portal. For information on how to create a bot resource through the Azure CLI, see how to Deploy your bot in Azure.

When you create a bot resource, Azure creates associated resources. Some of the resources created depend on how you decide to manage your bot's identity.

Your bot's identity can be managed in Azure in a few different ways.

  • As a user-assigned managed identity, so that you do not need to manage the bot's credentials yourself.
  • As a single-tenant app.
  • As a multi-tenant app.

Note

The user-assigned managed identity and single-tenant app types are only supported for C# and JavaScript bots:

  • The Bot Framework SDK for C# or JavaScript version 4.15.0 or later is required.
  • The SDKs for Python and Java only support multi-tenant bots.
  • Bot Framework Composer and Emulator only support multi-tenant bots.

Prerequisites

  • If you don't have an Azure subscription, create a free account before you begin.
  • The Bot Framework SDK for C# or Javascript version 4.15.0 or later, for user-assigned managed identity and single-tenant bots.

Create the resource

Create the Azure Bot resource, which will allow you to register your bot with the Azure Bot Service.

Warning

Web App Bot and Bot Channels Registration are deprecated but existing resources will continue to work. You should use Azure Bot, instead.

  1. Go to the Azure portal.

  2. In the right pane, select Create a resource.

  3. In the search box enter bot, then press Enter.

  4. Select the Azure Bot card.

    Select Azure bot resource

  5. Select Create.

  6. Enter values in the required fields. Choose which type of app to create and whether to use existing or create new identity information.

    Create a user-assigned managed identity Azure Bot resource with a new app ID.

  7. Select Review + create.

  8. If the validation passes, select Create.

  9. Select Go to resource group. You should see the bot and related resources listed in the resource group you selected.

  10. Select Get the SDK from GitHub to build your bot with the Bot Framework SDK.

    Create bot in SDK

Tip

When Azure creates a new single-tenant or multi-tenant Azure Bot resource with a new app ID, it also generates a password and stores the password in Azure Key Vault.

Key Vault is a service that provides centralized secrets management, with full control over access policies and audit history. For more information, see Use Key Vault references for App Service and Azure Functions. You're charged a small fee for using the service. For more information, see Key Vault pricing.

Bot identity information

You need to add identity information to your bot's configuration file. The file differs depending on the programming language you use to create the bot.

Important

The Java and Python versions of the Bot Framework SDK only support multi-tenant bots. The C# and JavaScript versions support all three application types, for managing the bot's identity.

Language File name Notes
C# appsettings.json Supports all three application types for managing your bot's identity.
JavaScript .env Supports all three application types for managing your bot's identity.
Java application.properties Only supports multi-tenant bots.
Python config.py Only supports multi-tenant bots. Provide the identity properties as arguments to the os.environ.get method calls.

The identity information you need to add depends on the bot's application type. Provide the following values in your configuration file.

Only available for C# and JavaScript bots.

Property Value
MicrosoftAppType UserAssignedMSI
MicrosoftAppId The client ID of the user-assigned managed identity.
MicrosoftAppPassword Leave this blank for a user-assigned managed identity bot.
MicrosoftAppTenantId The bot's app tenant ID.

To add the user-assigned managed identity to your bot's web app:

  1. Go to the app service page for your bot's web app.
  2. In the navigation pane under Settings, select Identity.
  3. On the Identity pane, select the User assigned tab and Add (+).
  4. On the Add user assigned managed identity pane:
    1. Select your subscription.

    2. For User assigned managed identities, select the managed identity for your bot. If the managed identity was auto-generated for you, it will have the same name as your bot.

    3. Select Add to use this identity for your bot.

      The App Service Identity page with the managed identity for the bot selected.

To get your bot's app or tenant ID:

  1. Go to the Azure Bot resource page for your bot.
  2. Go to the bot's Configuration pane. From here you can copy the bot's Microsoft App ID or App Tenant ID.

Tip

When Azure creates a single-tenant or multi-tenant bot, it stores the app password in Azure Key Vault.

To get the bot's app password from Azure Key Vault, see:

Additional information

Note

The Bot Framework Composer and Emulator currently only support multi-tenant bots. The Bot Framework SDK for C# or Javascript version 4.15.0 or later is required for user-assigned managed identity and single-tenant bots.

Skill support

Some types of skill consumers are not able to use some types of skill bots. The following table describes which combinations are supported.

  Multi-tenant skill Single-tenant skill User-assigned managed identity skill
Multi-tenant consumer Supported Not supported Not supported
Single-tenant consumer Not supported Supported if both apps belong to same tenant Supported if both apps belong to same tenant
User-assigned managed identity consumer Not supported Supported if both apps belong to same tenant Supported if both apps belong to same tenant

For information on how to configure a skill or skill consumer, see Implement a skill or Implement a skill consumer.

Next steps