How to persist bot state to CosmosDB using CI/CD?
See original GitHub issueWe have a Composer bot that we are not deploying manually via a publish profile, but instead followed the documentation here: https://docs.microsoft.com/en-us/composer/how-to-cicd
However, that documentation does not describe how to get the Composer bot to write bot state to an existing CosmosDB container. I have tried setting app settings in the Azure App Service for cosmosDb:authKey
, cosmosDb:cosmosDbEndpoint
, cosmosDb:containerId
, etc., and equivalents replacing “:” with “__”, but to no avail. We simply never see state in CosmosDB. I figured these app settings would be valid per the documentation here showing how the app settings are defined in the publish profile (plus, this is how the C# templates structure the app settings OOTB as well): https://docs.microsoft.com/en-us/composer/how-to-provision-azure-resources#share-resource-details
Incidentally, I have also tried setting these app settings in Composer’s configuration advanced editor locally to write to my CosmosDB Emulator but also to no avail.
Please don’t tell me to configure the publish profile as the answer - that is not the answer for many enterprise scenarios and the Bot Framework team should well know it. Similarly, please don’t simply link me to Bot Framework C# documentation about setting bot state, because I’ve authored several C# Bot Framework solutions and know very, very, very well how to get that to work.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
Top GitHub Comments
Ok, finally got this working. It seems value
CosmosDbPartitionedStorage
is the proper incantation needed forruntimeSettings:storage
with the connection details defined in a config section of the same name.Here’s the snippet from the ARM template’s app settings I have that is now finally writing bot state to CosmosDB:
I only found this because I created another bot from a template and provisioned/deployed to a personal Azure subscription and dug into the publish files to find how it was actually configured in the settings file from the publish profile.
Please document this sort of thing. All the various app settings / configuration options as loaded by Composer should be fully documented.
Yeah, my bad.
CosmosDB
was an older, allowed config option. Looks like it is onlyCosmosDbPartitionedStorage
now. Glad you got it working.