Manvendra Singh
Validate when access tier was changed for a blob

Change Access Tiers of a blob and Azure storage account

April 20, 2022 by

This article will explain the Access Tier property of Azure storage. I will also explain how to change access tiers of an Azure storage account and for a specific blob object in this article. We have explored the basics of Azure storage in my last articles below which I would suggest you read to understand Azure blob storage.

  • Getting started with Azure Storage
  • Understanding Azure BLOB storage and its uses in SQL Server

Azure blob storage is a type of Azure storage that can be used to store a huge set of unstructured data. We can also use this storage type for Azure data lake analytics solutions. The first step towards creating blob storage is to create a storage account. Below are high-level steps you must follow to create blob storage and store the unstructured data in that blob container.

  • Log in to the Azure portal
  • Create a storage account
  • Create a container
  • Upload blob data

Read the above-mentioned articles to learn the step-by-step process to create a storage account, container, and steps to upload a blob object.

When we create a storage account, it will use the default access tier i.e., Hot tier. Sometimes you don’t need a hot tier as your requirement has very limited data access like the SQL Server backup files kept under short-term or long-term retention policy etc. If you use hot tier for these backup files which will be kept as part of retention, then it will cost you more. A better option to save storage cost on such requirements is to change the access tiers of their storage account or of a specific backup file that you want to keep for the longer term. Today, I will explain how to manage the access tier of storage accounts and blob objects in this article.

Access Tiers in Azure storage

There are various types and nature of data we store in Azure storage. All types of blob data have different accessibility requirements. Sometimes data accessibility reduces over time whereas accessibility remains the same for some types of blob data. There is no point to pay the same price for data that is rarely being accessed or not accessed at all. Azure provides Access Tiers property to address such scenarios to optimize the cost on blobs that has less accessibility.

Azure storage offers two options standard and premium to create a storage account from a performance standpoint. If you choose the standard option (GPv2 storage) while creating a storage account then this option will allow you to leverage 3 access tiers i.e., Hot, Cool, and Archive for a blob object. Premium storage option doesn’t allow these options and it is by default created with preconfigured access tier which offers better performance and accessibility than the hot tier of standard storage option. We can choose an appropriate access tier based on the frequency and nature of data accessibility.

We can only use 2 access tier options at the Azure storage account level whereas all 3 access tier options can be used at the blob object level. If we upload any blob object to a storage account container, it inherits access tiers from the default access tier setting of the storage account in case you will not specify it for that blob. You can identify any blob object whether it is using an inherited default access tier, or their access tier has been modified. If a blob object has an access tier set with a word Inferred along with its access tier option like Hot (Inferred) or cool (Inferred), it means this setting is inherited from the default access tier of the storage account. If we change the access tier of the Azure storage account, then a new access tier will apply to all blobs that are using the inherited access tier having the inferred option.

Let’s discuss a little more about all 3 access tiers of the Azure blob storage.

Hot tier

You should use the hot tier if you need frequent data accessibility (read, write operations) with low latency. Most of the transactional workload uses this tier to get optimal performance. This tier will charge you the highest for storage cost and lowest for access cost among all 3 tiers.

Cool tier

This tier is suitable for infrequent data access requirements. It also gives good performance and durability. The pricing for this tier is lower than the hot tier for storage cost and higher than the hot tier for access cost. This tier is ideal for backups, DR, or any unstructured data which are not used frequently. The minimum retention to store data in this tier is 30 days.

Archive tier

This tier is priced lowest for storage cost and highest for access cost among all 3 access tiers. This is suitable for blob data which you use occasionally like long-term backup retentions, any data which you want to preserve and will not use for a longer time. The data stored in this tier is in offline mode and cannot be read and modified. You need to rehydrate the data if you want to use it. The rehydration process may time a lot of time to serve you the actual data, so the performance is very low in this tier. You can store data in achieve tier starting from 180 days onwards.

There are some limitations as well in the Archive tier. It does not support all types of redundancy options like Hot and Cool tiers. It does not support Zone-redundant storage (ZRS), Geo-zone-redundant storage (GZRS), and Read-Access Geo-Zone redundant storage (RA-GZRS). There is also one constraint in migrating redundant option from LRS to GRS, you can move to GRS if updates are done within the last 30 days and you have not moved any blob to GRS since it was configured to LRS redundancy.

We can set an access tier while creating the Azure storage account, we can also change it later after its creation. We have only 2 options Hot and Cool access tiers at the account level whereas the Archive access tier can be set only at blob or object level which I have demonstrated in the second last image of this article. If you upload any blob to a container, it inherits the access tier from its respective storage account in case you explicitly do not change it during upload. Later we can change the access tier of any object or blob as per our requirement. Changing the access tier from hot to cold to achieve will charge you for reading and write operations.

The cost impact of changing Access tiers

Changing the access tier process performs some read and write operations in the background to copy data between different tiers of Azure storage. These read and write options are chargeable in case you are using the GPv2 storage option so consider it while making your decision to change this access tier. You will always be charged on the lower access tier i.e., cooler access tier. Let me explain it more.

  • If you change the access tier from Hot to Cool, Cool to Archive, or Hot to Archive tiers then you will be charged for only write operations on the destination access tier. It means charges will be calculated based on write operations performed on cool or archive tiers only. You will not be charged for any read operations from the hot tier. The write operation will be charged based on the number of writes and size of blobs i.e. per 10000 write operations and per GB data written to destination tier.
  • If you want to move to warmer tiers like from Archive to Cool, Archive to Hot, or cool to hot access tiers then you will be charged for only read operations on source access tiers. It means charges will be measured based on reading operations performed on cool or archive access tiers. Here, also you will not be charged for any write operations on the hot tier. Again, the read operations will be measured based on the number of reads and size of data read at source tier i.e., per 10000 read operations and per GB data read at source tier.

As we know, the minimum retention for the cool access tier is 30 days whereas it’s 180 days for the archive tier. If you delete any blob data in less than their minimum retention days, then you will be charged with early deletion fees for the remaining days left till minimum retention tenure. If you move data from hot to cool tier and you want to delete that data from cool tier after 10 days since changing access tier, then you will be charged for 20 days as early deletion fees which are left to reach the minimum acceptable retention tenure for cool tier. You will also be charged early deletion fees if you change its access tier again from cool to other access tiers before its minimal acceptable retention period.

Change Access Tier of a Storage account

As explained above, the Azure storage account supports only 2 access tiers i.e., Hot, and cool. All blob objects use the default access tier inherited from the Azure storage account if you will not specify it for that blob. If you change the storage account level access tier, then the access tier of all blob objects which are using the inherited access tier from the respective storage account will also change to new access configured for the storage account. Although you can change the access tier for a specific blob object if you want to keep it with the existing access tier. Let’s change the access tier of an Azure storage account from Hot to Cool.

  1. Log in to the Azure portal.
  2. Type “Storage Accounts” from the search console and click on this option once it will appear in the search dropdown.
  3. I have already created a container mdsblob in the Azure storage account mdsstorage1 to store unstructured data. We can see its access tier is set as Hot in the below image. check Azure storage account access tier

    I have also uploaded a blob object to this storage account. Click at Containers from the left side pane and then I clicked at my container under which I have uploaded below the object. We can see its access tier is set as Hot (Inferred) which means it is inherited from the Azure storage account access tier setting.

    Check access tier of a blob stored in Azure blob storage

  4. Now, I will change the access tier of storage account mdsstorage1 and verify its details, I will also show you whether the access tier of the above blob object has changed or not after applying change at the Azure storage account.
  5. Go to the storage account overview page and click on the Hot option set for Default access tier configuration. You will jump to its configuration page as shown in the below image. You can also click on the Configuration tab showing under Settings from the left side pane.

    Change default access tier of storage account

  6. Select the radio button for Cool and click on the Save button showing the top right-side pane.

    Change default access tier of storage account

  7. Now, go back to the Overview page of your storage account and validate this change. We can see now access tier is set to Cool in the below screenshot.

    validate access tier of storage account

Let’s verify whether this change has applied to the blob object stored in this storage account. We can see the access tier for this object has also changed to Cool (Inferred) using the default access tier of the storage account.

Validate blob tier

I have shown you how to change the access tier of a storage account in this section. The below section will explain the steps about changing access tiers of a specific blob object.

Change Access Tier of a blob object

We saw the access tier has changed of a blob stored in Azure blob storage in case we change the access tier of that Azure storage account. Now, I will show you how to change the access tier of a stored object. The access tier of the above blob has changed to Cool (Inferred) after changing its default access tier of the storage account. Now, I will change the access tire of the above blob to Hot keeping its storage account default access tier the same as Cool.

  1. Log in to the Azure portal
  2. Type “Storage Accounts” from the search console and click on this option once it will appear in the search dropdown
  3. I have already created a container mdsblob in the storage account mdsstorage1 to store unstructured data. Go to the container mdsblob, you will get a similar screen as shown in the above image
  4. Click at the Change tier option showing in a dark red rectangle of the below image. You need to select the identified blob to enable this button. It is generally disabled as shown in the above image. You can also click at 3 dots showing the near least state column of this object

    Change blob access tier

  5. The below screen will appear to change the access tier for this blob

    Change blob access tier

    Choose your desired access tier for this blob. I have chosen back to Hot and clicked on the Save button. The save button will be enabled once you will select your choice.

  6. The change will apply once you will hit the save button on the above screen. The below image is showing that the Access tier has been successfully changed and now blob is displaying its access tier as Hot. One thing you will also notice is that there is the Inferred text showing in this access tier configuration, which means this access tier setting is not inherited from the default access tier of the Azure storage account.

    Validate access tier change for a blob

You can also get the last time when the access tier was modified by accessing the “Change tier” screen again as shown in the below image. You can also notice, there is no access tier option available with Inferred text from the drop-down menu.

Validate when access tier was changed for a blob

Conclusion

Access Tier is a very important storage property in Azure storage. It defines your data accessibilities and the storage cost of all stored data. You should plan and change the access tier for data that is not being accessed frequently to save storage costs. We can change the access tier at the storage account level as well as blob object level.

Manvendra Singh
Azure

About Manvendra Singh

Manvendra is a database enthusiast, currently working as a Senior Architect at one of the top MNC. He loves to talk and write about database technologies. He has lead and delivered many projects from designing to deployments on Migrations to the cloud, heterogeneous migrations, Database consolidations, upgrades, heterogeneous replication, HA / DR solutions, automation, and major performance tuning projects. You can also find him on LinkedIn View all posts by Manvendra Singh

168 Views