title: Azure, access denied on Shared Access Signature for Storage 2.0
body: <p>I'm having trouble getting shared access signatures to work with Storage 2.0..</p>
  
  <p>I use the code:</p>
  
  <pre><code>if (blob.Exists())
  {
      var expires = DateTime.UtcNow.AddMinutes(30);
      var sas = blob.GetSharedAccessSignature(new Microsoft.WindowsAzure.Storage.Blob.SharedAccessBlobPolicy
      {
          Permissions = Microsoft.WindowsAzure.Storage.Blob.SharedAccessBlobPermissions.Read,
          SharedAccessExpiryTime = expires
      });
      url = string.Concat(blob.Uri.AbsoluteUri, sas);
  }
  return url;
  </code></pre>
  
  <p>But if I debug the session and paste the URL into a browser, I get an error:</p>
  
  <pre><code>&lt;Error&gt;
    &lt;Code&gt;AuthenticationFailed&lt;/Code&gt;
    &lt;Message&gt;
  Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:c1a1dd2b-bf4a-4a6b-bab2-ab1cb9363d27 Time:2012-11-19T14:41:51.1254531Z
    &lt;/Message&gt;
    &lt;AuthenticationErrorDetail&gt;
  Signature did not match. String to sign used was r 2012-11-19T15:11:36Z /container/path/1356/pic.jpg 2012-02-12
    &lt;/AuthenticationErrorDetail&gt;
  &lt;/Error&gt;
  </code></pre>
  
  <p>Can anybody help?</p>
  
  <p>UPDATE:
  A resulting URL looks like:
  <a href="https://storageaccountname.blob.core.windows.net/container/path/1356/pic.jpg?sv=2012-02-12&amp;se=2012-11-19T19%3A25%3A32Z&amp;sr=b&amp;sp=r&amp;sig=s6QIdwAGY4xC8fs4L9pK8hAGIY%2F8x58aqBcFbejYPdM%3D" rel="nofollow">https://storageaccountname.blob.core.windows.net/container/path/1356/pic.jpg?sv=2012-02-12&amp;se=2012-11-19T19%3A25%3A32Z&amp;sr=b&amp;sp=r&amp;sig=s6QIdwAGY4xC8fs4L9pK8hAGIY%2F8x58aqBcFbejYPdM%3D</a></p>