title: AzureStorage Blob Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature
body: <p>I'm trying to upload a image in Windows Azure Blob and I'm geting the following error which I can't handle.</p>
  <blockquote>
  <p>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.</p>
  </blockquote>
  <p>The error occurs when I try to create a container.</p>
  <pre class="lang-cs prettyprint-override"><code>container.CreateIfNotExists()
  </code></pre>
  <p>Here is my code</p>
  <pre class="lang-cs prettyprint-override"><code>try
  {
      Microsoft.WindowsAzure.Storage.CloudStorageAccount storageAccount = Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(ConfigurationManager.AppSettings[&quot;StorageConnectionString&quot;]);
      CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); 
  
      // Retrieve a reference to a container. 
      CloudBlobContainer container = blobClient.GetContainerReference(&quot;samples&quot;);
  
      // Create the container if it doesn't already exist.
      // here is the error
      if (container.CreateIfNotExists())
      {
          container.SetPermissions(
              new BlobContainerPermissions
              {
                  PublicAccess = BlobContainerPublicAccessType.Blob
              });
      }
      
      CloudBlockBlob blockBlob = container.GetBlockBlobReference(&quot;Image1&quot;);
      using (var fileStream = System.IO.File.OpenRead(@&quot;Path&quot;))
      {
          blockBlob.UploadFromStream(fileStream);
      }
  }
  catch (StorageException ex1)
  {
      throw ex1;
  }
  </code></pre>
  <p>I have tried a lot of options in my code but still getting the error.</p>