Search code examples
azurebotframework

How to configure v3 Bot using Azure Bot Service


We are running chatbots using BotFramework v3. Now Microsoft changed from 'Bot Channel Registration' to 'Azure Bot' service which uses a key vault. Until that the bot had to be configured by storing the Microsoft app id and app password in Web.config or the app services app settings. Now we only get the app id but no password because it's managed by identities and stored in the key vault.

Incoming messages arrive at the bot but outgoing messages raises 'Unauthorized' error.

How can we configure the BF v3 bot correctly? We used UserAssignedMSI as bot type.


Solution

  • Thanks to AP01, this was very useful.

    Creating a Azure Bot resource of type MultiTenant solved my problem. Under "Configuration" you can manage the app password and generate a new secret. Be sure to set its lifetime to 24 month and make a note to your future self to renew it after 2 years. Set the MicrosoftAppId and MicrosoftAppPassword in the web-apps app settings and MicrosoftAppType to MultiTenant.

    There is no need for creating a key vault and an identity resource (I got these 2 when I've created the Azure Bot resource of type UserAssignedMSI).