How to access a file that is stored in SQL Azure BLOB Storage and read the contents fo the file

Jul 22, 2011 at 5:22 AM


I am trying to migrate large data that is required for our website hosted on Azure to access. The data amounts to about 7GB. After reading few forums, I have come to know that  SQL Azure BLOB Storage can do the trick for me. Can anyone please let me know how we can store data in  SQL Azure BLOB Storage and access it?

At first I want to try to store a Test.txt file in the BLOB and access the contents of this file from our website and display it.


Thank you very much in advance


Aug 1, 2011 at 4:09 AM

Hi Sandeep,

You may do it like:

To upload file, get Filestream of it and use following:

Microsoft.WindowsAzure.StorageClient.CloudBlob.UploadFromStream(Stream content);

Download file as stream:





Microsoft.WindowsAzure.StorageClient.CloudBlob.DownloadtoToStream(Stream content);

You have stream with you now, you can do anything you want from this file.