Increase Azure blob block upload limit from 32 MB

我是研究僧i 提交于 2019-12-07 01:58:29

Storage clients default to a 32 MB maximum single block upload. When a block blob upload is larger than the value in SingleBlobUploadThresholdInBytes property, storage clients break the file into blocks.

As Tamra said, the storage client handles the work of breaking the file into blocks. Here is my tests for you to have a better understanding of it.

Code Sample

CloudBlockBlob blob = container.GetBlockBlobReference(blobName);
var writeOptions = new BlobRequestOptions()
{
    SingleBlobUploadThresholdInBytes = 50 * 1024 * 1024, //maximum for 64MB,32MB by default          
};
blob.UploadFromByteArray(contents, 0, contents.Length, AccessCondition.GenerateIfNotExistsCondition(), options: writeOptions);

Scenario

  1. If you are writing a block blob that is no more than the SingleBlobUploadThresholdInBytes property in size, you could upload it in its entirety with a single write operation.

    You could understand it by capturing the Network Package via Fiddler when you invoke the UploadFromByteArray method.

  2. When a block blob upload is larger than the value in SingleBlobUploadThresholdInBytes property in size, storage clients break the file into blocks automatically.

    I upload a blob which size is nearly 90MB, then you could find the difference as follows:

    Upon the snapshot, you could find that storage clients break the file into blocks with 4MB in size and upload the blocks simultaneously.

Every time the blob is over 32MB, the above raises an exception

You could try to set the SingleBlobUploadThresholdInBytes property or capture the Network Package when you invoke the UploadFromByteArray method to find the detailed error.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!