Azure Archive Tier Blob Storage preview

I wrote a post last autumn regarding the Hot and Cool Blob Storage alternatives (https://peter.intheazuresky.com/2016/09/01/azure-hot-and-cold-blob-storage/) and tried to point out the differences between them. Now a third option for Blob Storage is in preview named Archive Tier Blob Storage. The purpose of this storage seems to be long-term storage of blobs that you (almost) don’t need to access at all but still need to save for different reasons, for example legislative reasons. The introduction of this tier also brings a new feature which affects my recommendations from the old post and I will likely have to update the post once the new Tier reaches global availability (which should be very soon).

Archive Storage consist of two major changes:

  1. It introduces a new pricing tier for cheap long-term/non-frequently accessed Blobs names Archive Storage Tier
  2. As Archive Storage Tier is (currently) only available for individual blobs it enables tier selection on Blob level for the old existing tiers (Cold & Hot) also. It effectively enables a mix of hot, cold and archive Blobs within the same Blob storage account.

How do I use it?

Well first of all (as long as this is still in preview) you have to enable it in your subscription. You can find a link on how to do this in the references section.

So when you create your storage account you still have to decide a tier. This cannot be set to archive (yet?).

Create Blob Storage
Create Blob Storage

The access tier you select in the wizard will be the default tier which can be overridden by individual blobs later.

When you upload some files they will be assigned to the default tier.

You can now go in and alter the Blob Access Tier properties (though code or portal). In the portal you can select a blob and change its tier.

Change Access Tier on Blob
Change Access Tier on Blob

So now your singe storage account may contain Blobs of all types

Different Tiers in same Blob storage
Different Tiers in same Blob storage

So what does the Archive Tier do?

The archive tier differs from the others by targeting long-term storage of Blobs that you are unlikely to ever (or extremely seldom) access again. The pricing is not set but I assume that it will become extremely cheap for the storage part but at the same time I assume it may be connected with some kind of un/de-archiving fee (see more later).

So what is the drawback? You cannot read or write Blobs on demand in Archive Storage. You have to convert them to Hot or Cool storage before attempting these operations. You can however, list and delete the Blobs. Un/De-archiving (bringing them back to hot or cold storage) is not instant either (I have read that you should assume a restore time in the unit of hours) so if you need instant access to a blob the Archive Tier is not the suitable tier for your blob.

An open question that I described in my old post was that conversion of a large Blob storage from one tier to another could become expensive in some cases. Now with the enablement of Blob Level Access Tiers you may not be forced to take that cost by converting between cold and hot tiers, maybe one could just convert the Blobs actually needed or maybe go through Cool to Archive to Hot to avoid this cost. But that is impossible to tell at this moment (purely speculation on my side) as we haven’t seen the pricing model for the Archive yet. Maybe the pricing for restoring archives is the expensive bit and should be avoided.

Upload directly with a certain tier

Unfortunately this feature is not available as of now. It is however one of the most desired wishes in the preview community for archive storage so today you need to upload it first to the default tier and then directly change the tier. It is not much code but still seems like an unnecessary operation if you already know which tier you want to use for the Blob at the time of upload.

string localFile = @”c:\temp\localfile.txt”;

var blockBlob = container.GetBlockBlobReference(“uploadedToArchive.txt”);

// Upload blob and set to blob to be stored in archive tier
using (var fileStream = System.IO.File.OpenRead(localFile))
{
blockBlob.UploadFromStream(fileStream);
blockBlob.SetStandardBlobTier(StandardBlobTier.Archive); //Change to archive
}

Similarly you can use the following statements to set an uploaded blob to the other tiers. This does not have to be when uploading the blob but at any point in time.

blockBlob.SetStandardBlobTier(StandardBlobTier.Cool); //Change to Cool

blockBlob.SetStandardBlobTier(StandardBlobTier.Hot); //Change to Hot

Programmatically determine Blob tier

You can also easily list which tier the Blob is stored in through the Properties.StandardBlobTier property on the blob.

foreach (IListBlobItem item in container.ListBlobs(null, false))
{CloudBlockBlob blob = (CloudBlockBlob)item;
Console.WriteLine($”Found Blob {blob.Name} Type {blob.Properties.StandardBlobTier.ToString()});
}

Downloading an Archived Blob

If you try to download a Blob in Archive Tier you will get an exception of error code 409.

Error downloading Archive File
Error downloading Archived Blob
where HttpStatus 409 (explanation taken from https://httpstatuses.com/409 ): “The request could not be completed due to a conflict with the current state of the target resource. This code is used in situations where the user might be able to resolve the conflict and resubmit the request.” which is exactly the case in this example because by setting the Blob to another Tier and waiting for it to be restored will enable you to download the file.

Summary

The new Archive Tier and the possibility to change the Tier for each Blob can be a useful feature looking forward. Lets closely follow how the pricing will be set once it reaches global availability.

References

You can read some more information about it and get instructions on how to try it out on the below link:

https://azure.microsoft.com/en-us/blog/announcing-the-public-preview-of-azure-archive-blob-storage-and-blob-level-tiering/

For the pricing differences, use this link (once it is the preview is nearing its end)

https://azure.microsoft.com/en-us/pricing/details/storage/blobs/

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s