Search code examples
azureazure-storagebotsazure-bot-service

Why do we need storage account for Web App bot but not in Bot Channel Registration


Before my question I will present my current knowledge on the bot services.

  1. Web app bot is used to create a new full fledged bot service that can be modified, build and deployed online.
  2. But Bot Channel registration is used to simply register the existing bot (that has been created offline in Visual Studio etc.) to any channel using Azure in order to generate App ID, password etc.

But When I am trying to create a Web app bot, then a storage account option is displayed whereas it is not displayed in channel registration. enter image description here

I want to understand why do we need Storage account here whereas it is not required when doing bot channel registration. Also what is the purpose of the Storage account here?


Solution

  • As @David said, the storage is used to store bot state data, you could find it in the portal when creating the bot. Because the bot does not exist before creating it, so you should specify the storage account. If you created a bot through the Azure portal then your bot is already registered with the Bot Service.

    enter image description here

    To Bot Channel Registration, we already have a bot hosted elsewhere, we register a bot with Bot Service to connect it to other channels. Of course, it is necessary to store the state data.

    If we use storage to store data, in the Web.config file, we need to add

    <connectionStrings>
        <add name="StorageConnectionString"
        connectionString="YourConnectionString"/>
    </connectionStrings>
    

    For more details about managing state data using Table storage, refer to this article.

    Also, you can manage state data using Cosmos DB, it depends on you.

    In general, we should have already specified the way in the code tier to store the state data, so there is unnecessary to choose Storage when creating Registration in the portal.