New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to persist bot state to CosmosDB using CI/CD? #8864
Comments
Can you confirm the runtimeSettings:storage set to the name of your cosmosDB?: "runtimeSettings": {
"storage": "cosmosDB",
}, |
I can confirm that configuration was not set because I didn't see that documented anywhere. Even now Googling for that isn't yielding anything. Nonetheless, I tried adding Azure App Service app setting named How might I know all the configuration settings that are available to the Bot Framework Composer's runtime? If I'm to assume that Azure App Service app settings get loaded by the Bot Framework Composer's runtime, I have to believe there is a combination of settings to make it work. |
@dmvtech - I think I initially misread your message. The runtimeSettings:storage setting is to be the name of the Cosmos DB? Do you mean the CosmosDB account, or the actual database ID within the account? Or is it to be the full connection string? Only giving a database name (id) doesn't seem like it could be sufficient... I could use a clarifying explanation please. |
Ok, finally got this working. It seems value 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. |
Thanks @nicolas-martin-dte
This would be name of the configuration node. I think it can be anything, but I would need to test to confirm (you may be able to do so before I could get to it). So, for example, either of these should work: {
"runtimeSettings" : {
"storage": "CosmosDbPartitionedStorage"
},
"CosmosDbPartitionedStorage": {
"authKey": "",
"containerId": "",
"cosmosDBEndpoint": "",
"databaseId": ""
}
} OR {
"runtimeSettings" : {
"storage": "CosmosDB "
},
"CosmosDB ": {
"authKey": "",
"containerId": "",
"cosmosDBEndpoint": "",
"databaseId": ""
}
} @JonathanFingold for docs input. |
I tried the latter with no success. Maybe I had a case mismatch or something, but it didn't appear to work for me. |
Yeah, my bad. |
We 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-detailsIncidentally, 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.
The text was updated successfully, but these errors were encountered: