how to list blobs with uncommitted blocks

Andy A 0 Reputation points
2024-05-01T20:29:49.1933333+00:00

I am uploading large number of small and bigs files using put block and put block list.

I am looking for ways to cleanup when put block list fails or upload is interrupted.

  1. Currently I do not see a way to list the blobs that are not commited and have uncommitted blobs.
  2. The max uncommitted blob is 100k. My application uploads large amount of data and may reach this limit easily. Is it possible to extend this limit or another suggested solution.
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,480 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Amrinder Singh 2,770 Reputation points Microsoft Employee
    2024-05-02T02:36:49.1633333+00:00

    HI Andy A - Thanks for reaching out on Q&A Forum.

    This is Hard limit and can't be increased.

    You can make use of Get Block List API

    https://learn.microsoft.com/en-us/rest/api/storageservices/get-block-list?tabs=microsoft-entra-id

    You can make use of blocklisttype parameter and pass the value as all which shall list all the committed and un-commited blocks associated with the blobs.

    blocklisttype Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together. Valid values are committed, uncommitted, or all. If you omit this parameter, Get Block List returns the list of committed blocks.
    blocklisttype Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together. Valid values are committed, uncommitted, or all. If you omit this parameter, Get Block List returns the list of committed blocks. Please let us know if you have any further queries. I’m happy to assist you further.

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


  2. Anand Prakash Yadav 6,465 Reputation points Microsoft Vendor
    2024-05-02T09:23:36.98+00:00

    Hello Andy A,

    Thank you for posting your query here!

    Currently I do not see a way to list the blobs that are not commited and have uncommitted blobs.

    Uncommitted blocks are automatically deleted after 7 days. If you want to delete them sooner, one possible solution is to call Put Block List with an empty or a single uncommitted block and then delete the blob. That way all uncommitted blocks will be deleted. Another option would be to create another blob with the same name using Put Blob operation.

    You can retrieve the uncommitted block list by making a Get Block List URI request in which the blocklisttype URI parameter is set to uncommitted: https://learn.microsoft.com/en-us/troubleshoot/azure/azure-storage/blobs/connectivity/invalid-blob-or-block-content-or-invalid-block-list#solution-3-commit-the-uncommitted-block-list-by-using-the-azure-storage-sdk

    The max uncommitted blob is 100k. My application uploads large amount of data and may reach this limit easily. Is it possible to extend this limit or another suggested solution.

    The maximum number of uncommitted blocks that can be associated with a blob is 100,000. If this limit is exceeded, the service returns status code 409 (RequestEntityTooLargeBlockCountExceedsLimit). Unfortunately, this limit cannot be extended.

    To handle large uploads, consider breaking your data into smaller blocks. Also, try to commit blocks as soon as possible to avoid reaching the uncommitted block limit.

    Do let us know if you have any further queries. I’m happy to assist you further.

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments