CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobName); using (MemoryStream stream = new MemoryStream()) { blockBlob.DownloadToStream(stream); string contents = Encoding.UTF8.GetString(stream.ToArray()); Console.WriteLine(contents); }
CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobName); using (FileStream stream = new FileStream(filePath, FileMode.Create)) { blockBlob.DownloadToStream(stream); }Both of these examples demonstrate how to use the DownloadToStream method of the CloudBlockBlob class to download the contents of a blob to a stream. There are many other methods available in the Microsoft.WindowsAzure.Storage.Blob package library for working with blobs in Azure Storage.