C# Azure Storage Blob Upload TransactionScope -
is there somewhere class allow roll transactionscope on azure blockblob actions ?
i make works:
cloudblockblob blockblob; private void uploadpicture(stream istream) { using(var ts = new transactionscope()) { blockblob.uploadfromstream(istream); throw new exception(); ts.complete(); } }
when exception raise, uploaded file not cancelled. if not possible transaction scope, how should proceed ?
azure storage client library not provide support. if, however, cancellation support acceptable scenario, can use uploadfromstreamasync api cancellationtoken. while asynchronously uploading blob, can cancel operation. depending on operation's current progress, try abort upload.
Comments
Post a Comment