georgiosd
georgiosd

Reputation: 3059

Do Azure storage-related APIs participate in System.Transactions?

I can't find any information on this anywhere and yet the question is simple.

Can I wrap storage-related actions in a TransactionScope such that e.g. if there is a rollback, the uploaded file is rolled back also?

If the native APIs don't do this already, is there a public implementation anywhere?

Upvotes: 7

Views: 1384

Answers (2)

Michael Trullas
Michael Trullas

Reputation: 664

As already answered, there is no built-in support for transactions as you have in SQL connections for example.

As you are using .NET, you can take advantage of .NET Transactions and build one yourself. Here you can see this more information in this related question:

Generic ResourceManager/IEnlistmentNotification for Azure Blob Storage operations to achieve 2 phase commit

Upvotes: 0

David Makogon
David Makogon

Reputation: 71030

If you're referring to Table or Blob updates, there's no notion of explicit commit or rollback. When you make an API call (whether direct REST call or via PowerShell / CLI / SDK), it's just an action against storage, and it will either succeed or fail (although some actions take a while and the call may return before completion). There's no transaction scope wrapping this action. You'd need to take care of undoing your Table / Blob updates at an app level.

Upvotes: 8

Related Questions