Register a bot with Azure
APPLIES TO: SDK v4
This article shows how to register a bot with the Azure Bot Service when you develop and host it in Azure.
If the bot is hosted elsewhere, you can also make it available in Azure and connect it to the supported channels. You supply the web address where your bot is hosted.
You only need to register a bot if it is not hosted in Azure. Bots created using the Azure portal or the Command Line Interface (CLI) are already registered with the Azure Bot Service. For more information, see Deploy your bot.
Create an Azure Bot resource
The Azure Bot resource enables you to register your Bot Framework Composer or SDK bot in Azure Bot Service. 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.
Web App Bot and Bot Channels Registration will be deprecated but existing resources will continue to work. You should use Azure Bot, instead.
Go to the Azure portal.
In the right pane, select Create a resource.
In the search box enter bot, then press Enter.
Select the Azure Bot card.
Enter the required values. The following figure shows Create new Microsoft App ID selected.
You can also select Use existing app registration and enter your existing app Id and password.
Select Review + create.
If the validation passes, select Create.
Select Go to resource group. You should see the bot and the related Azure Key Vault resources listed in the resource group you selected.
The app secret (password) is stored in the the key vault and there is one key vault per resource group. Using key vault is recommended instead of copying and storing sensitive data.
Select Open in Composer. This is the recommended path, if you are new to bot development or if you are building a brand new bot. Follow the steps described in the Create a bot in Composer article.
Optionally, select Get the SDK from Github to build your bot with the Bot Framework SDK that helps you create everything from a modest chatbot to world class, enterprise solutions.
About Azure Key Vault
Azure 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. Note that you will be charged a small fee for using the service, For more information, see Key Vault pricing.
App Id and password
You need the Azure bot resource app Id and password to configure your bot for deployment. You will assign their values to the related variables:
MicrosoftAppPassword contained in your bot project configuration file. The file differs depending on the programming language you use to create the bot, as shown in the table below.
Get Azure bot resource app Id
- Go to the Azure portal.
- Select the Azure bot resource to obtain its app Id.
- In the left pane, in the Settings section, select Configuration.
- Copy and save the value contained in the Microsoft App ID box.
Get Azure bot resource password from the Azure key vault
You can access the Azure Key Vault to obtain your resource stored password. Azure Key Vault is a service that provides centralized secrets management, with full control over access policies and audit history. Fpr more information, see Use Key Vault references for App Service and Azure Functions.
- About Azure Key Vault
- Assign a Key Vault access policy using the Azure portal
- Quickstart: Set and retrieve a secret from Azure Key Vault using the Azure portal
Manual app registration
A manual registration is necessary for situations like:
- You are unable to make the registrations in your organization and need another party to create the App ID for the bot you're building.
- You need to manually create your own app ID and password.
When creating the app, in the section Supports account types, choose one of the following multi-tenant types options:
|Accounts in any organizational directory (Any Azure AD - Multitenant)||This option provides less exposure by restricting access and in case OAuth is not supported.|
|Accounts in any organizational directory (Any Azure AD - Multitenant) and personal Microsoft accounts (for example, Xbox, Outlook.com)||This option is well-suited to support OAuth and bot authentication.|
For more information, see Register an application with the Microsoft identity platform.
Update the bot
Set the following key values in the
MicrosoftAppId = <appId>
MicrosoftAppPassword = <appSecret>