Anatoly
Anatoly

Reputation: 1916

How to use WindowsAzure.Storage.DataMovement?

 TransferManager.UploadAsync(@"C:\data2.flac",
                             destinationBlob,
                             null,
                             context,
                             CancellationToken.None).Wait();

This code perfectly works when I upload to block blob storage.

How can I use WindowsAzure.Storage.DataMovement when I upload to page blob?

Now I get

Unhandled Exception: System.AggregateException: One or more errors occurred. ---> Microsoft.WindowsAzure.Storage.DataMovement.TransferException: File size 274.02MB is invalid for PageBlob, must be a multiple of 512 bytes.

Upvotes: 0

Views: 156

Answers (1)

Gaurav Mantri
Gaurav Mantri

Reputation: 136336

As the error message states, in order to upload a file as page blob the size of the file must be a multiple of 512 bytes. Because your file does not match this criteria, your upload is failing. You would need to specify a file which matches this size restriction.

The reason there's this size restriction is because you mount these page blobs as drives and use them with your Virtual Machines.

Upvotes: 2

Related Questions