I'm trying to download a blob file as a bytearray from my blob account on Azure. I do this.
var blockBlob = blobContainer.GetBlockBlobReference(id);
using (var mStream = new MemoryStream())
{
blockBlob.DownloadToStreamAsync(mStream);
result = mStream.ToArray();
}
The code above returns me a empty stream. I do have the file on my azure blob account and I checked the uri that is generated by code and it's the same that the one on my azure blob for the file I want to download as bytearray.
Is there a better way to download a azure blob file as bytearray in c#?