admin管理员组文章数量:1123198
My C# program downloads a list of files from an Azure Storage blob using Azure.StorageServices.BlobService
. But once it reaches a particular mono-2.0-bdwgc.dll
file, I get a Response failed with status: 403 Forbidden
response.
All of the downloaded files can be accessed anonymously. In fact, I can even open the
[...]/mono-2.0-bdwgc.dll
URI in a browser and it downloads the file with no issue.If explicitly try to download the file at the start of the program, it also downloads it just fine. It only seems to complain if I try while downloading the whole list of blobs.
A barebones excerpt of my code:
StorageServiceClient client = StorageServiceClient.Create(STORAGE_ACCOUNT, blobKey);
blobService = client.GetBlobService();
...
for (int i = 0; i < blobsToDownload.Count; i++)
{
await blobService.GetBlob(OnBlobReceived, blobsToDownload[i]);
}
private async void OnBlobReceived(IRestResponse<byte[]> response)
{
if (response.IsError)
{
// This fails with 403 Forbidden
throw new Exception($"{(int)response.StatusCode} {response.ErrorMessage} {response.Url}");
}
...
}
I've noticed Microsoft recently changed the recommended x-ms-version
header on MSDN to 2025-01-05, so I followed suit, but nothing changed.
Does anyone know why it would fail on this particular file on this particular occasion?
本文标签: cAnonymous blob download sometimes return 403 ForbiddenStack Overflow
版权声明:本文标题:c# - Anonymous blob download sometimes return 403 Forbidden - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736553288a1944542.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论