Search code examples
azurevisual-studio-2012azure-storage-emulator

Azure Storage Emulator - (400) Bad Request - HTTP headers is not in the correct format


I am trying to perform some simple actions with the Azure storage emulator and consistently encounter the exception "The remote server returned an error: (400) Bad Request." Going into RequestInformation>ExtendedErrorInformation I also see "The value for one of the HTTP headers is not in the correct format."

This is an example of code that fails:

CloudStorageAccount storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true");

CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");

container.CreateIfNotExists(); // This is where it fails

I have found some cases where this might be a SDK version issue. I am running Visual Studio 2012. I have installed version 2.6 of Azure SDK for .NET, since this is the last supported version of VS 2012.

Based on the simplicity of the code, I imagine this is an issue with the environment. I am very new to working with Azure, so I wouldn't be surprised if there is something minor I am missing. Any and all help is appreciated.


Solution

  • You need to upgrade to the latest version of the Storage Emulator. You can get the latest Storage Emulator as a standalone installer (not part of the SDK) at the Azure Download page under "Command line tools".