title: I am getting Bad Request (400) messages for Emulated and REAL Azure storage
body: <p>I am developing an Azure website, and I want to make use of Blob storage. I am using VS2013, Azure SDK 2.2. I have tried Azure Storage 2.1.0.4 from NuGet, I have tried using the latest 3.0.2.0 too. I have upgraded the emulator to the latest preview version 2.2.1, I was using 2.2.0 before.</p>
  
  <p>My issue is, it doesnt matter if I point at the emulator or real storage, I get Bad Request 400 errors (invalid headers).</p>
  
  <p>I set up a really simple form application, with a single button to make this easy.</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
     var account = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
  
     CloudBlobClient blobClient = account.CreateCloudBlobClient();
  
     CloudBlobContainer container = blobClient.GetContainerReference("UserImages");    
  
     if (!container.Exists())
     {
        container.Create();
        container.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Off });
     }
  
  }
  </code></pre>
  
  <p>Everything looks good until container.Exists() executes, and then I get an unhandled error (Bad Request 400). I have tried a few different operations and I get the same unhelpful message every time.</p>
  
  <p>I am storing the Azure Connection string in the appSettings section, and in this simple example I have tried pointing at a real Storage Account, and the emulator, and I get the 400 error every time.</p>
  
  <p>My config file has this:</p>
  
  <pre><code>&lt;appSettings&gt;
      &lt;add key="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=[MyAccountName];AccountKey=[MYREALKEY]" /&gt;
  &lt;/appSettings&gt;
  </code></pre>
  
  <p>Using the Server Explorer in VS2013, I can happily connect to both the Emulator and real storage, and access Blob storage without issue.</p>
  
  <p>This is effectively stopping me adding the ability to my site to upload files to the storage account.</p>
  
  <p>Anyone else having this problem? As far as I know, I have tried older versions and the latest versions of the important components. I have always had SDK 2.2 though.</p>
  
  <p>Any suggestions gratefully received.</p>
  
  <p>For information, I followed this example, which I found in the Azure management portal:
  <a href="http://www.windowsazure.com/en-us/documentation/articles/storage-dotnet-how-to-use-blobs-20/" rel="nofollow">http://www.windowsazure.com/en-us/documentation/articles/storage-dotnet-how-to-use-blobs-20/</a></p>
  
  <p>Thanks</p>
  
  <p>Ian</p>