0

i have migrated my bot from v3 to v4 i have made configuration settings "always on" also but if bot is idle more than 1 hour i am getting retry message.

could you please provide the solution i have used blobstorage for state.

please find the below code.

Global.asax.cs code

 string botdialogstorage = ConfigurationManager.AppSettings["BotDialogStorageContainer"];
            string storageConnectionString = KeyVaultManager.GetKeyVaultSecret(CDPOSConfigurationManager.GetAppSetting("StorageConnectionStringSecret"));
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(storageConnectionString);
            CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
            CloudBlobContainer container = blobClient.GetContainerReference(botdialogstorage);
            AzureBlobStorage _myStorage = new AzureBlobStorage(storageConnectionString, container.Name);
            // Create Conversation State object.
            // The Conversation State object is where we persist anything at the conversation-scope.
            var conversationState = new ConversationState(_myStorage);
            builder.RegisterInstance(conversationState).As<ConversationState>().SingleInstance();

            // Register the main dialog, which is injected into the DialogBot class
            builder.RegisterType<RootDialog>().SingleInstance();

            // Register the DialogBot with RootDialog as the IBot interface
            builder.RegisterType<DialogBot<RootDialog>>().As<IBot>();

            var container1 = builder.Build();
            var resolver = new AutofacWebApiDependencyResolver(container1);
            config.DependencyResolver = resolver;
nagulu vemula
  • 119
  • 1
  • 10
  • Are you still suffering from this issue? – Yutong Tie Jul 13 '20 at 18:48
  • your token might be expiring after an hour of inactivity. Refer to https://github.com/microsoft/botframework-sdk/issues/4322 and https://stackoverflow.com/questions/60085336/how-should-a-botframework-webchat-conversation-be-maintained-for-over-an-hour for webchat and https://stackoverflow.com/questions/53662567/bot-built-with-ms-bot-sdk-4-quites-working-for-facebook-channel-after-an-hour-or for Facebook channel. – ranusharao Jul 14 '20 at 22:12

0 Answers0