Reputation: 1477
I am trying to upload a Vhd (sizing atleast 30GB) to a page blob in azure storage in an mvc web application. Due to size of the file i can not upload this large file as a whole as browsers don't allow this large request to be sent. So, the only option is to upload file in chunks (i.e. 4mb). on client size i am able to do chunking and i am sending chunks to my server side controller through an ajax request (in a loop). But using .net sdk for azure i am not finding a way to upload chunks to a page blob.
P.S There is a way to upload file in chunks in block blob using putblock() and putblocklist() methods and i am able to achieve the uploading in that way but i need to create a VM image out of the uploaded vhd and for that purpose it needs to be a page blob. So, i would welcome any guidance to show me the way to upload vhd in chunks in a Page Blob using azure .net sdk.
Upvotes: 1
Views: 992
Reputation: 6467
You can try AzCopy tool without writing any code.
AzCopy /Source:C:\myfolder /Dest:https://myaccount.blob.core.windows.net/mycontainer /DestKey:mykey /Pattern:abc.vhd /BlobType:Page
Upvotes: 1
Reputation: 136356
You could use CloudPageBlob.WritePages
method to upload the chunks of data. Please see this blog post from Azure Storage Team for an example of using this method: http://blogs.msdn.com/b/windowsazurestorage/archive/2010/04/11/using-windows-azure-page-blobs-and-how-to-efficiently-upload-and-download-page-blobs.aspx.
Upvotes: 0