O'Reilly logo

Microsoft Azure Development Cookbook Second Edition by Neil Mackenzie, Roberto Freato

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Leasing a blob and implementing distributed locks

As the same services of Azure consume the Blob storage as a service, it needed some features to be enabled for complex scenarios. One of these is to allow an Azure virtual machine to exclusively access a blob (a VHD, for example), preventing other clients to access it in any way. To provide this feature, Blob Storage has the lease function: a lock-like status in which a blob cannot be written by anybody except the one who owns the lease.

A blob can be leased for 15 seconds up to 60 seconds (or infinite), and it can be renewed as many times as needed (while it is still locked). This is particularly useful with page blobs as they can be updated with random writes. Indeed, the Azure virtual machines ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required