[FEATURE REQ] OpenWriteAsync to leave existing blob content alone until Flush() is called on the stream #43242
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-team-attention
This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Service Attention
This issue is responsible by Azure service team.
Storage
Storage Service (Queues, Blobs, Files)
Library name
Azure.Storage.Blobs
Please describe the feature.
BlockBlobClient
'sOpenWriteInternal
method returnsBlockBlobWriteStream
. This stages blocks and adds their IDs to a list_blockIds
.The
CommitInternal
method actually commits the blocks to become the new content of the blob. I only see one call to that, fromFlushInternal
, which is called fromFlush
andFlushAsync
.This seems excellent because it suggests I can attempt to write an updated version to the same blob name, and if there is a failure part way through so I never call
Flush
, the blocks will be abandoned and the previous version of the blob's contents are unharmed.However, before returning the
BlockBlobWriteStream
, theOpenWriteInternal
does something mystifying!:That is, it immediately truncates the blob, destroying its current contents before anything to replace it has been sent.
Is this necessary? Is it possible to add a switch to
BlockBlobOpenWriteOptions
to make it not do that?The text was updated successfully, but these errors were encountered: