1
我有一系列我想要处理的blob。我的计划是得到一个404错误,抛出一个异常这样的:C#不从Azure blob存储中检索blob
ErrorCode:BlobNotFound
ErrorMessage:The specified blob does not exist.
容器上的访问策略设置不当,当我粘贴记录的URI到我的浏览器(例如,这样的:https://atpblob.blob.core.windows.net/darkskydata/plot1251time2010-01-02t00:00:01z.json
)它下载罚款。
下面是相关代码:
Console.WriteLine(daily.BlobUri);
CloudBlockBlob blockBlob = container.GetBlockBlobReference(daily.BlobUri);
string text;
using (var memoryStream = new MemoryStream())
{
blockBlob.DownloadToStream(memoryStream);
text = System.Text.Encoding.UTF8.GetString(memoryStream.ToArray());
}
Console.WriteLine(text);
我在做什么错?