Storing MemoryStream File to Azure Blob
Try and set the Position of your memory stream to 0 and see if that helps. Something like the code below:
msImage.Position = 0;//Move the pointer to the start of stream.
// Create or overwrite the "myblob" blob with contents from a local file.
using (var fileStream = msImage)
{
blockBlob.UploadFromStream(fileStream);
}
I had the same problem, the code works but the pdf file size was always 0, I had to make the MyMemoryStream.Position = 0; below is the code I have used. Hope it helps someone.
using (pdfStream)
{
pdfStream.Position = 0;
blob.UploadFromStream(pdfStream);
_model.ConvertedPdfUrl = blob.Uri.AbsoluteUri;
}