Mitesh Patekar
Mitesh Patekar

Reputation: 43

Azure Bot Framework custom state cosmosdb data is null

I am trying to store conversations and state of Bot framework in Cosmos DB.
I followed the documentation here-
https://learn.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-state-azure-cosmosdb

After following the steps, the object is created in cosmosdb but the data property object is null.
CosmosDB data property is null Image

Thanks,
Mitesh

Upvotes: 1

Views: 359

Answers (1)

Fei Han
Fei Han

Reputation: 27805

Using Azure Cosmos DB to store and manage bot’s state data is working for me, if I store data in UserData or ConversationData, I can view the data via Data Explorer on Azure Cosmos DB portal. As Eric Dahlvang mentioned in his comment, please check if you store some data in your code logic. Or you can put my code snippet in your bot app and test if it works for you.

Store state data:

context.UserData.SetValue("mytestdata", activity.Text.ToString());

or

context.ConversationData.SetValue("mytestcdata", "this is test Conversation Data");

View the state data:

enter image description here

enter image description here

Upvotes: 1

Related Questions