Azure AppendBlob number of block/writes

被刻印的时光 ゝ 提交于 2019-12-06 11:33:31

In Azure Reference, you can find the table of Blob Service Error Codes which list the error codes may be returned by an operation against the Blob service includes Conflict 409, please see below.

The details for the maximums of AppendBlob, you can refer to the section About Append Blobs of the reference page Understanding Block Blobs, Append Blobs, and Page Blobs as below.

Each block in an append blob can be a different size, up to a maximum of 4 MB, and an append blob can include up to 50,000 blocks. The maximum size of an append blob is therefore slightly more than 195 GB (4 MB X 50,000 blocks).

As @yonisha said, if using REST API Append Block, you can get the block count for AppendBlob via get the response header x-ms-blob-committed-block-count which is the number of committed blocks present in the blob and can be used to control how many more appends can be done.

For C#, getting the block count via the property AppendBlobCommittedBlockCount form the BlobProperties for the object CloudAppendBlob, please see the reference BlobProperties.AppendBlobCommittedBlockCount Property.

For C# you can simply issue appendBlob.Properties.AppendBlobCommittedBlockCount.

Wissam

As written in the Operations on Append blob documentation, the only specific available operation on Append blob type is the 'Append Block' operation.

Nevertheless, you can get the committed block count from the x-ms-blob-committed-block-count response header of the Append Block operation. From the documentation:

The number of committed blocks present in the blob. This can be used to control how many more appends can be done.

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