Azure, Cost, Professional

Changing Access Tiers for Append and Page Blobs

Introduction

If managing an Azure ecosystem cost optimization is a key pillar. One such activity that can assist in cost optimization is the ability to scale storage access tiers. By changing access tiers one can significantly reduce their Azure storage costs. Previously this type of activity was limited to just block blobs, unless you wanted to go through a bunch of extra steps. That was before the GA announcement providing this functionality. Now one can switch the access tiers for append and page blobs.

Background

For those unfamiliar with Azure Blob Storage there are multiple types of blobs available.

  • Block Blob – most commonly used type of blob in Azure Storage. They are optimized for storing large amounts of unstructured data, such as text or binary data, in a single file. Block blobs are composed of blocks of data that can be uploaded or downloaded independently, allowing for parallel upload or download of large files. Block blobs are ideal for scenarios where data needs to be frequently updated or modified.
  • Append Blob – designed for scenarios where data needs to be written to a file sequentially. Append blobs are optimized for appending new data to the end of an existing file, rather than modifying existing data within the file. Append blobs are commonly used for logging or other scenarios where data needs to be written in a sequential manner.
  • Page Blob – are optimized for random access scenarios. They are designed to store large amounts of structured data, such as virtual hard drive files or database files, and provide low latency access to individual pages within the file. Page blobs are optimized for frequent read and write operations, making them ideal for scenarios where data needs to be frequently modified or accessed.

Use Case

Given these types of blobs a general use case could involve and industry where certain data is required to be stored for a certain length of time legally. Typically this can be seen in Healthcare and Financial industries. In this scenario an Append Blob that may track and store log activity could make a lot of sense.

Years of data stored in an Append Blob data access tier can add up quickly. So now with this functionally we have the ability to change the access tier of the Append Blob to something like archive which is a fraction of the cost with the trade off being it is available in up to 15 hours as opposed to almost instantaneous.

Process

At this stage I feel like it is appropriate to illustrate that this feature does not technical change the access tier of the Append/Page Blob. Rather it provides the capabilities to easily copy an existing Append/Page Blob to a new Block Blob with the desired storage tier. This feels like a bit of a misnomer; however, at this stage this is the easiest way to accomplish this.


$ctx = New-AzStorageContext -StorageAccountName <insert-storageAccountName> 

$containerName = 'appendblob'
$srcblobName = 'appendBlobTest.txt'
$destcontainerName = 'blockblob'
$destblobName = 'blockBlobTest.txt'
$destTier = 'archive'

Copy-AzStorageBlob -SrcContainer $containerName -SrcBlob $srcblobName -Context $ctx -DestContainer $destcontainerName -DestBlob $destblobName -DestContext $ctx -DestBlobType Block -StandardBlobTier $destTier

Full documentation on the Copy-AzStorageBlob module. As of the time of this writing this function can only be performed via PowerShell, Azure CLI, or AzCopy.

Conclusion

There you have it! A little misleading; however, the functionality on changing an Append/Page Blob to a different access tier is available. This feature will assist those who are attempting to keep a well cost Optimized Azure Environment. If cost optimization is something of interest to you I’d encourage you to check out some of my other posts on Azure Cost Management.