Azure存储:403服务器无法进行身份验证请求

问题描述:

我搜索在这里和在谷歌,但我不能找到一个解决方案。

I've search here and in Google but I can't find a solution.

使用我的C#code我想读Azure存储的Blob的文件。
在code(只有6行)的作品相当不错,在另一个项目(Windows 8.1中通用的应用程序),但不是在我的新的Windows 10 UWP应用程序。

With my C# code I want to read a file from Azure Storage Blob. The code (only 6 line) works very well in another project (Windows 8.1 Universal App) but not in my new Windows 10 UWP App.

这是我的code:

CloudStorageAccount storageAccount = CloudStorageAccount.Parse(azureConnectionString);
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("container-name");

CloudBlob b1 = container.GetBlobReference("27.76914.json");
StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync("stefano1.json", CreationCollisionOption.ReplaceExisting);
await b1.DownloadToFileAsync(file);

异常:

服务器无法验证请求。使确定的值
  授权头被正确地形成包括签名。

Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

使用Fiddler4我发现这个错误的消息,403:

在HTTP请求中发现的MAC签名R2t9hKsyXf470HF2LNP8T + M2nci0ddE / ojQ0r4UVjJQ ='是不一样的任何计算签名

The MAC signature found in the HTTP request 'R2t9hKsyXf470HF2LNP8T+M2nci0ddE/ojQ0r4UVjJQ=' is not the same as any computed signature

我尝试:


  1. 该应用程序在第一次(文件下载)。第二次我得到的异常。

  2. 如果我更改请求的文件名:应用程序的工作在第一时间(文件下载)。第二次我得到的异常。

  3. 第二天我立即得到相同的异常(在第一次运行)

  4. 另外,如果我删除bin和OBJ文件夹中我得到的错误

  5. 如果我创建另一个应用程序并尝试下载同一个文件(同1点),它的工作原理是第一次,但没有第二。

  6. 在一个控制台应用程序的所有作品很好。

这是Fiddler4原始请求(其中*****是我的Azure存储帐户名):

This is the Fiddler4 Raw Request (where ***** is my Azure Storage Account Name):

GET https://*****.blob.core.windows.net/container-name/27.76914.json HTTP/1.1
x-ms-client-request-id: accee7e7-646d-417a-b734-1591cbc16a8d
x-ms-date: Thu, 03 Sep 2015 06:31:37 GMT
x-ms-version: 2015-02-21
User-Agent: WA-Storage/5.0.2 (Windows Runtime)
Authorization: SharedKey *****:R2t9hKsyXf470HF2LNP8T+M2nci0ddE/ojQ0r4UVjJQ=
Host: *****.blob.core.windows.net
If-Modified-Since: Sun, 30 Aug 2015 18:52:41 GMT
If-None-Match: "0x8D2B16C2ED82C4A"
Connection: Keep-Alive

感谢您!

这另据报道,在这里我们的GitHub页面上:https://github.com/Azure/azure-storage-net/issues/171

This was also reported on our GitHub page here: https://github.com/Azure/azure-storage-net/issues/171

我们的主导理论是,缓存代理可能会在客户端和影响你的请求的服务器之间在

Our leading theory is that a caching proxy might be in between the client and the server affecting your requests.

我们仍在调查,并会通知你。

We're still investigating and will let you know.