I am trying to do some automation using PUT Block
in Azure Blob Storage.
My questions are:
Q1. Do uncommitted blocks reserve space?
Q2. How can I delete the uncommitted blocks?
GET Block List
.PUT Block List
and then delete the blob
altogether to free up space.Is there any better way of deleting uncommitted blocks?
Is there any better way of deleting uncommitted blocks?
As such there's no direct way of deleting uncommitted blocks. If you do not do anything with those blocks, they are automatically deleted after 7 days.
One possible solution would be to call Put Block List
with empty or a single uncommitted block and then delete the blob. That way all uncommitted blocks will be deleted.
Other option would be to create another blob with the same name using Put Blob
operation. Since your intention is to delete uncommitted blocks, you can create this blob as a zero byte blob.