I am currently learning about blob block storage. I would like to copy a block blob from one storage to another storage account.Usually when uploading from system to cloud the examples i saw was computing the block size and then using PutBlock and PutBlockList. I would like use the same method to copy from one storage account to another. using DownloadBlockList i am able to get blockid, but i am not able to get the data associated with block id.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse( ConfigurationManager.AppSettings["StorageConnectionString"]);
CloudBlobClient cloudBlobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = cloudBlobClient.GetContainerReference("input");
CloudBlockBlob blob = container.GetBlockBlobReference("Cloud.mp4");
List<string> commitedBlocks = new List<string>();
IEnumerable<ListBlockItem> blockItem = blob.DownloadBlockList(BlockListingFilter.All);
commitedBlocks.AddRange(blob.DownloadBlockList(BlockListingFilter.Committed).Select(id => id.Name));
);
If i am able to get the data associated with the block id then i can do a parallel copy of the blocks.
Thanks