10
votes

I'm using the latest Azure SDK Nuget package which is 3.0 released today and trying to work with Blob storage locally in my development environment. I created a blob in my local development storage using Azure Storage Explorer and am trying to read the data but getting a 400 Bad Request returned. When I dig into the response object returned by the exception it is saying "The value for one of the HTTP headers is not in the correct format."

The strange thing is that when I put the full URL in a browser it downloads the blob just fine (http://xxx.x.x.x:10000/devstoreaccount1/test/722b6bea-d609-48e0-a4af-3ed0f5160ad9)

Here is the code I am using:

        var storageAccount = Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse("UseDevelopmentStorage=true");
        var blobClient = storageAccount.CreateCloudBlobClient();
        var container = blobClient.GetContainerReference("test");

        var blob = container.GetBlockBlobReference("722b6bea-d609-48e0-a4af-3ed0f5160ad9");
        var text = blob.DownloadText();

I also tried creating a new blob in code and am getting the same exception

1

1 Answers

11
votes

Probably this post may help you:

http://social.msdn.microsoft.com/Forums/windowsazure/en-US/b1b66cc0-5143-41fb-b92e-b03d017ea3c1/400-bad-request-connecting-to-development-storage-using-azure-storage-client-ver-20?forum=windowsazuredata

Update

As pointed out by Gaurav Mantri in the comments:

Don't use Storage Client library 3.0 as it makes use of latest storage service version which is not yet supported in storage emulator. Based on the blog post by storage team, support for latest storage service version in emulator is coming in couple of months.