C # Azure Storage Blob Download TransactionScope

Is there somewhere a class that allows rollback with transaction to azure blockblob actions?

I would like to do this:

CloudBlockBlob blockBlob; private void UploadPicture(Stream iStream) { using(var ts = new TransactionScope()) { blockBlob.UploadFromStream(iStream); throw new Exception(); ts.Complete(); } } 

When an exception is a raise, the downloaded file is not canceled. If this is not possible in the area of ​​transactions, how should I proceed?

+5
source share
1 answer

The Azure Storage Client Library does not provide this support. If, however, cancellation support is supported for your scenario, you can use the UploadFromStreamAsync API with a CancellationToken . Although this is an asynchronous blob download, you can cancel the operation. Depending on the current progress of work, he will try to interrupt the download.

+1
source

Source: https://habr.com/ru/post/1216622/


All Articles