Microsoft.WindowsAzure.Storage v9.0 throws (400) Bad Request
See original GitHub issueUsing Bot Builder v3.13.1 with .NET 4.7.1
Getting the following storage exception upon upgrading to v9.0 from v8.7
I’ve the following code in Global.asax app start:
var config = GlobalConfiguration.Configuration;
Conversation.UpdateContainer(
builder =>
{
builder.RegisterModule(new AzureModule(Assembly.GetExecutingAssembly()));
builder.RegisterModule(new ReflectionSurrogateModule());
builder.RegisterModule<GlobalMessageHandlersBotModule>();
var tableBotDataStore = new TableBotDataStore(ConfigurationManager
.ConnectionStrings["StateStorageConnectionString"].ConnectionString);
builder.Register(c => tableBotDataStore)
.Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
.AsSelf()
.SingleInstance();
builder.Register(c => new CachingBotDataStore(tableBotDataStore,
CachingBotDataStoreConsistencyPolicy.LastWriteWins))
.As<IBotDataStore<BotData>>()
.AsSelf()
.InstancePerLifetimeScope();
// Register your Web API controllers
builder.RegisterApiControllers(Assembly.GetExecutingAssembly());
builder.RegisterWebApiFilterProvider(config);
});
Stack Trace:
[WebException: The remote server returned an error: (400) Bad Request.] System.Net.HttpWebRequest.GetResponse() +1340 Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync(RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:677 [StorageException: The remote server returned an error: (400) Bad Request.] Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync(RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:604 Microsoft.WindowsAzure.Storage.Table.TableOperation.Execute(CloudTableClient client, CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Table\TableOperation.cs:44 Microsoft.WindowsAzure.Storage.Table.CloudTable.Create(TableRequestOptions requestOptions, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Table\CloudTable.cs:1084 Microsoft.WindowsAzure.Storage.Table.CloudTable.CreateIfNotExists(TableRequestOptions requestOptions, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Table\CloudTable.cs:1211 Microsoft.Bot.Builder.Azure.TableBotDataStore..ctor(CloudStorageAccount storageAccount, String tableName) +142 Microsoft.Bot.Builder.Azure.TableBotDataStore..ctor(String connectionString, String tableName) +26 AzSGenie.<>c__DisplayClass1_0.<Application_Start>b__0(ContainerBuilder builder) in C:\Users\user1\Source\Repos\TestBot\TestBot\TestBot\Global.asax.cs:49 Microsoft.Bot.Builder.Dialogs.Conversation.UpdateContainer(Action`1 update) +153 AzSGenie.WebApiApplication.Application_Start() in C:\Users\user1\Source\Repos\TestBot\TestBot\TestBot\Global.asax.cs:31 [HttpException (0x80004005): The remote server returned an error: (400) Bad Request.] System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +475 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +176 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +349 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +303 [HttpException (0x80004005): The remote server returned an error: (400) Bad Request.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +657 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +89 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +188
--
Is this something related to design changes in v9.0?
Any further help would be greatly appreciated. Thanks.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Azure table storage returns 400 Bad Request
400 Error means there's something wrong with the value of one of your properties. One way to find out is to trace the...
Read more >Getting Bad Request Error 400 for Azure blob connection
I created a flow from Template (Create SharePoint file when an Azure Blob is added or modified), but when connecting to the blob...
Read more >image processor 400 error - Using Umbraco And Getting ...
hi guys, i'm having some issues with images in the umbraco ... hook up Umbraco (v7.15) to blob storage and I'm getting a...
Read more >Azure.Storage.Blobs 400 Bad Request - Microsoft Q&A
I am running an Azure Blob Trigger Storage Function locally using Azurite through Visual Studio 2022, and az login in Developer Powershell, ...
Read more >Azure Blob Storage error codes
Error code HTTP status code User message
BlobAlreadyExists Conflict (409) The specified blob already exists.
BlobNotFound Not Found (404) The specified blob does not exist.
ContainerAlreadyExists...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@erezvani1529 Ok. I don’t think it’s tied to emulator as I’ve seen the same with other channels like Web Chat and bot hosted in Azure.
As Eric mentioned, this issue seems to be related to https://github.com/Microsoft/BotBuilder-Azure/issues/58
@mcinnes01, are you using the emulator or running against Storage Account?
I have tried the samples and the HotelBot and after upgrade with latest Emulator or Storage Account I dont see any issues.