Writing straight to the Azure Storage Access Tier you want (with AzCopy)

Introduction

With the “Set Blob Tier” operation you can set the Access Tier of the blob object of a storage account. Now at times you know a certain object will go to tier that’s not your default access tier. Or you want to write immediately to archive. The cool thing is that AzCopy can assist you in this!

 

AzCopy Flags

Take a look at the AzCopy flags… Here you’ll notice the “–block-blob-tier” flag. This is the one that’ll help you on writing directly to the access tier you want.

Quick Demo

I’ve created a storage account in mint condition, where the default access tier is set to “Hot”.

Next up, I’ve created 4 files of 10MB with the names ; hot, cool, archive & premium

To show that I’ve got nothing up my sleeve, the storage account has one container (called “test”) which is fully empty.

Let’s generate an access token for it.

 

And copy that URL…

Now we’re going to copy all those files over, whilst setting the access tier to represent each file ;

First lesson of today; This is not possible for premium storage (yet)!

Though let’s check how things are looking in our container…

BOOM! Each file is in the access tier it needs to be in.

 

Takeaways of the day

You can use AzCopy to immediately select the hot, cool or archive access tier for a given object/blob. Premium isn’t supported yet.

The default access tier can be set to hot or cool. Though if you want to write immediately to archive, then you’ll need to work with the setting the access tier flag.

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 )

Google photo

You are commenting using your Google 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

This site uses Akismet to reduce spam. Learn how your comment data is processed.