Search code examples
azurebotframework

Testing bot application in Azure not responding


I’m using Azure Enterprise subscription and created a chat bot using same. But currently, I’m having trouble chatting using it. The bot is created using Visual studio using Bot framework and published to Azure. https://pihitsupportbot001.azurewebsites.net/ is my messaging end-point URL. I made bot channel registration for the same application and used the bot api endpoint with api/messages as end-point for it. Updated web config file with generated app ID and password and published. But when I try testing with web chat in Azure it is throwing ‘couldn’t send retry’. What would be the reason?


Solution

  • The error was due to the reason In global.asax I didn't have any state specified to store the conversation history. Earlier Microsoft had been providing a default state service for bots built using either the Node.js or .NET SDK’s. The state service is used to store and retrieve user and conversation data within the context of a conversation. But in fact in local while running using emulator or even in IIS, it doesn't need to have it. below is the documentation.

    Bot State Service will soon be retired on March 31st, 2018

      var store = new TableBotDataStore(ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString);
        Conversation.UpdateContainer(
       builder =>
       {
           builder.Register(c => store)
                     .Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
                     .AsSelf()
                     .SingleInstance();
    
           builder.Register(c => new CachingBotDataStore(store,
                      CachingBotDataStoreConsistencyPolicy
                      .ETagBasedConsistency))
                      .As<IBotDataStore<BotData>>()
                      .AsSelf()
                      .InstancePerLifetimeScope();
       });