VERSIONING YOUR BLOBS IN MICROSOFT AZURE – A STEP BY STEP DEMO

A lot of Azure users have applications that perform read and write transactions against blobs in their storage account. Sometimes it’s common for an application to mistakenly modify or delete one of your blobs in the storage account, and customers need a way to recover from this in a simple and seamless way. And that’s exactly what blob versioning allows you to do. Blob versioning allows you to restore an earlier version of your blob in case an application or you mistakenly modify or delete it.

A version keeps the state of a blob at any given point in time. So, when you modify a blob, what Azure Storage will do is automatically create a new version that captures the state of that blob right before it was modified, so that newly modified blob becomes the new current version, and that original blob becomes a previous version. Even if you delete that blob, its previous version still persists, so you can use those previous versions to recover the blob at a later point in time.

Let’s go ahead and see a demo of this.

Go to your storage account and to the data protection tab. Simple enable the versioning for blobs and click save. It is this simple. What’s more is that you can enable this at the time of creating your storage account as well.

 

Now when you enable blob versioning, Azure Storage will automatically create and maintain versions on your behalf.

Now for example I have this container where I have several images that are important to me.

 

If suppose say that I accidentally delete this image.

 

But I deleted that image by mistake and now I want it back. What is the way that I can get that image back? Here is where versioning comes in the picture and it is super easy.

Click Show Deleted Blobs and you will see that Azure Storage has identified this image as a deleted one

 

Click on the image and go to the versions tab of it. You will see that Azure Storage has created a version and captured the previous state of the blob before it was deleted. And this is what you want to recover.

 

To recover the image, simply select the version and make it the current version.

 

Now you will see that the image is Active and ready to be used again.

 

It is important to know that in this scenario, the blob only had one previous version, but it’s possible that a blob could have more than hundreds of previous versions. Azure Storage will automatically create a version for you anytime the blob is modified. For instance, if you were editing this photo and you were making hundreds of edits to it. For every edit that you make, Azure Storage will create a version for you to capture the state before it was modified. And so, suppose you made hundreds of edits and you didn’t like them, and you want the original state of your photo back. With Azure Storage blob versioning, you can do that. All you have to do is find the previous version that captured the state of your original blob and use that and make it the current version. You can see how easy it is to do blob versioning in Azure.