Booley
Booley

Reputation: 859

How to perform atomic batch uploading to Azure Blob Storage?

For my application, I need to upload several blobs to different containers in Azure Blob storage as part of a single transaction; that is, either all the files are uploaded successfully or none of them are, so there is no partial upload if the connection breaks, for instance.

It seems the blob storage API does not support batch uploading, so I need to implement it on my end. I considered using TransactionScope, but according to this post the uploaded blob is not cancelled if an exception is raised. Is there a way I can work around this issue?

Upvotes: 2

Views: 666

Answers (1)

David Makogon
David Makogon

Reputation: 71120

There is no specific transaction-management for blobs. You'd have to build something into your app to synchronize your blob writes across multiple blobs (or manage the metadata in an alternate database, accordingly). How you do that is really up to you and your app's design.

Upvotes: 4

Related Questions