I want to get a specific block from an azure block blob with the blockId, is this even possible? something like
var blockBlob = new BlockBlobClient(connectionString, containerName, blobName);
var blocklist = await GetBlobBlockList(blobName, cancellationToken);
var firstBlock = blocklist.First();
var memStream = new MemoryStream();
await blockBlob.DownloadStreamingAsync(memStream, firstBlock.Name);
I want to get a specific block from an azure block blob with the blockId, is this even possible?
It should be possible to do so however it won't be as simple as you mentioned in your sample code.
Here's what you would need to do:
0
to n - 1
block and add the size of each block.DownloadRangeToStreamAsync(Stream, Nullable<Int64>, Nullable<Int64>)
, where your offset
value will be the sum of the size of each block calculated in step 2 and length
value will be the size of the block you wish to download.