public async Task<HttpResponseMessage> Post([FromBody]Activity activity)
{
ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl));
if (activity.Type == ActivityTypes.Message)
{
Activity isTypingReply = activity.CreateReply();
isTypingReply.Type = ActivityTypes.Typing;
await connector.Conversations.ReplyToActivityAsync(isTypingReply);
StateClient sc = activity.GetStateClient();
BotData userData = await sc.BotState.GetUserDataAsync(activity.ChannelId, activity.From.Id); // have to check on monday
if (!userData.GetProperty<bool>("ChannelUserData"))
{ // fetch user details
Above snippet from MS Bot SDK 1.x application to update user data in the state. Now I'm trying to upgrade old bot application to Microsoft Bot SDK 3.x. I'm using Cosmos Db to store state value.
How can I store or update user data with channelId and From Id? Once I fetch user details, I'm updating it asawait sc.BotState.SetUserDataAsync(activity.ChannelId, activity.From.Id, userData);
After a year, am reopening Microsoft application and a lot of changes in it. So, I couldn't fetch proper documentation. Can someone help/guide me the state storage process using Cosmos DB?
Followed Basic Setup https://docs.microsoft.com/en-us/azure/bot-service/dotnet/bot-builder-dotnet-state-azure-cosmosdb?view=azure-bot-service-3.0