Azure blob API sometimes looks like it's been designed by aliens. Like designed for some very exotic use cases when most simple ones require jumping through the hoops. Here is one such.
I have two worker roles. One is creating blobs, another one is processing them (and moving to "completed" folder when processing is done). The blob size can be moderately big, like 100 MB. Obviously, I don't want second role to start reading the blob before the blob has all the data. Okay, one can expect the help from the Lease API: acquire the lease, copy the blob, release the lease. Then, reader will also try to acquire the lease before processing and therefore will have to wait. But no, lease can't be acquired on a blob that does not exist yet. Also, I couldn't find any method that creates a blob with the lease "on" as an atomic operation.
Please let me know if you know the trick to make it work. Sincerely Yours.