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);
我在做什麼錯?