public static MemoryStream DownloadBlockBlob(DownloadBlockBlobSettings downloadBlockBlobSettings)
{
Contract.Requires(downloadBlockBlobSettings != null, "The copy block blob settings cannot be null.");
var storageAccount = new CloudStorageAccount(new StorageCredentialsAccountAndKey(downloadBlockBlobSettings.BlobStorage, downloadBlockBlobSettings.BlobStorageKey), downloadBlockBlobSettings.UseHttps);
var client = storageAccount.CreateCloudBlobClient();
var container = client.GetContainerReference(downloadBlockBlobSettings.ContainerName);
var blockBlob = container.GetBlockBlobReference(downloadBlockBlobSettings.BlobPath);
using (var memoryStream = new MemoryStream())
{
blockBlob.DownloadToStream(memoryStream);
return memoryStream;
}
}