How To Lower Your Azure File Shares Cost With Hot and Cool Tiers

9 min read

In this article, I will share with you how to create new storage tiers, update existing Azure file shares to optimize and lower your storage costs.

Introduction

Azure Files offers shared storage for applications using the standard SMB 3.0 protocol. Microsoft Azure virtual machines and cloud services can share file data across application components via mounted shares, and on-premises applications can access file data in a share via the File storage API.

Applications running on Azure virtual machines can mount a File storage share to access file data, just as a desktop application would mount a typical SMB share. Any number of Azure virtual machines or roles can mount and access the File Storage share simultaneously.

Microsoft also introduced Azure File Sync service which allows you to centralize your file shares in Azure Files, whilst maintaining the compatibility of an on-premises file server with all the flexibility and performance benefits that provide.  For more information about Azure File Sync and how to get started, please check the following step-by-step guide.

At Microsoft Ignite 2019 last year, the team of the Azure files announced a new storage tiers option for standard storage accounts in addition to the premium tier which will optimize cost and performance for your workload. The new 3 tiers are called ‘Transaction Optimized, ‘Hot‘, and ‘Cool‘.

How To Lower Your Azure File Shares Cost With Hot and Cool Tiers 1

New Tiers [Image Credit: Microsoft Ignite 2019]

Unfortunately, due to the pandemic situation, the release process took some additional time, and now finally the new tiers are available publicly in ‘certain‘ Azure regions.

Storage tiers overview

Azure Files offers today four different tiers of storage called as premium, transaction optimized, hot, and cool to allow you to tailor your shares to the performance and price requirements of your workload:

  • Premium: Premium file shares are offered on solid-state disk (SSD) storage media and useful for IO-intensive workloads, including hosting databases and high-performance computing (HPC).
  • Transaction optimized (formerly known as standard): Transaction optimized file shares are offered on rotational hard-disk (HDD) storage media and useful for general purpose file shares. Low transaction charges make this tier ideal for larger sets of files with high-churn. This tier of storage has historically been called “standard”, however, this refers to the storage media type rather than the tier itself (the hot and cool are also “standard” tiers because they are on standard storage hardware).
  • Hot: Hot file shares are useful for most general-purpose workloads, including for lifting and shifting an on-premises file share to Azure, and especially with Azure File Sync.
  • Cool: Cool file shares offer cost-efficient storage optimized for online archive storage scenarios. This tier is more useful for lightly used file shares, where data is to be stored for long term access without compromising the capability of instant online access to the data.

At the time of this writing, the Hot and Cool tiers are publicly available in certain Azure regions only, and they are also being rolled out in other Azure regions.

Updated: Hot and Cool file shares are available in all Azure Public and Azure Government regions. The Transaction Optimized file shares are available in all Azure regions, including Azure China and Azure Germany regions.

Create a hot and cool file shares

To deploy a hot, cool, or transaction optimized file share, you need to have a storage account with a general-purpose version 2 (GPv2) type. Please note that version 1 storage account type is not supported.

At the time of this writing, the Azure portal does not yet support creating hot and cool file shares or moving existing transaction optimized file shares to hot or cool. You need to use PowerShell or the Azure CLI.

Microsoft just enabled Azure Portal support, so you can create hot, cool, Transaction optimized file shares or moving existing transaction optimized file shares to hot or cool. You can also use PowerShell or the Azure CLI.

Create a hot and cool tier with PowerShell

To create a hot and cool tier with PowerShell, you need first to have the Az PowerShell module installed on your machine, as well as the Azure storage preview module.

Assuming you don’t have any module installed on your machine, open PowerShell 7.0 session as Administrator and run the following commands:

#! Install the Az PowerShell module
Install-Module -Name Az -AllowClobber -Force

#! Uninstall the existing Az Storage module
Uninstall-Module -Name Az.Storage -Force

#! Install the preview Az Storage module
Install-Module -Name Az.Storage -RequiredVersion "2.1.1-preview" -AllowClobber -AllowPrerelease

#! Login and authenticate to Azure AD
Connect-AzAccount

Once you connect to your Azure account and have all the PowerShell modules updated as shown in the figure below, you can start creating file shares with different tiers.

How To Lower Your Azure File Shares Cost With Hot and Cool Tiers 2

Before we start creating different tiers, I will create a new storage account in the supported Azure region. Please note that if you have an existing storage account with general-purpose v2 in one of the supported regions mentioned above, you can use it as well.

#! Creating a general purpose v2 storage account type as Standard_LRS
#! Azure region: France Central
$rgName = "weu-afs-mvp-rg"
$storageName = "storageaccountname"
New-AzStorageAccount -ResourceGroupName $rgName `
     -StorageAccountName $storageName `
     -SkuName Standard_LRS -Location francecentral
#! Creating file share with Hot Tier
#! Please note that if you don't specify the quota size in GiB, the default file share size will be created with 5Tib.
$rgName = "weu-afs-mvp-rg"
$storageName = "storageaccountname"
$shareName = "fileshare-hot-tier01"
New-AzRmStorageShare -ResourceGroupName $rgName `
     -StorageAccountName $storageName -Name $shareName `
     -AccessTier Hot -QuotaGiB 100

How To Lower Your Azure File Shares Cost With Hot and Cool Tiers 3

#! Creating file share with Cool Tier
#! Please note that if you don't specify the quota size in GiB, the default file share size will be created with 5Tib.
$rgName = "weu-afs-mvp-rg"
$storageName = "storageaccountname"
$shareName = "fileshare-cool-tier01"
New-AzRmStorageShare -ResourceGroupName $rgName `
    -StorageAccountName $storageName -Name $shareName `
    -AccessTier Cool -QuotaGiB 100

How To Lower Your Azure File Shares Cost With Hot and Cool Tiers 4

#! Creating file share with Transaction Optimized Tier (formerly called Standard)
#! Please note that if you don't specify the quota size in GiB, the default file share size will be created with 5Tib.
$rgName = "weu-afs-mvp-rg"
$storageName = "storageaccountname"
$shareName = "fileshare-txo-tier01"
New-AzRmStorageShare -ResourceGroupName $rgName `
    -StorageAccountName $storageName -Name $shareName `
    -AccessTier TransactionOptimized -QuotaGiB 100

How To Lower Your Azure File Shares Cost With Hot and Cool Tiers 5

Finally, to list the existing file shares with PowerShell and see their Access Tiers, you can run the following command:

#! List the existing file shares with PowerShell and sort by Access Tiers
$rgName = "weu-afs-mvp-rg"
$storageName = "storageaccountname"
Get-AzRmStorageShare -ResourceGroupName $rgName `
     -StorageAccountName $storageName | Sort AccessTier

How To Lower Your Azure File Shares Cost With Hot and Cool Tiers 6

Create a hot and cool tier with Azure CLI

Now if you prefer to use the Azure CLI, you can also do the same and create the desired tiers.

You can either install the latest Azure CLI version 2.10.1 on your machine, or jump over the Cloud Shell (https://shell.azure.com), or use the Azure Cloud Shell Connector in Windows Terminal.

You need to have Azure CLI v2.10.1 or later installed to create the new tiers.

How To Lower Your Azure File Shares Cost With Hot and Cool Tiers 7

Login to Azure and set the desired subscription by running the following commands:

az login
az account set --subscription "Subscription-ID-Here"

The syntax to create different tiers in Azure CLI is the following:

#! Creating file share with Hot Tier with Azure CLI
#! Please note that if you don't specify the --quota size, the default file share size will be created with 5Tib.
#! Please note that if you don't specify the Access Tier, then TransactionOptimized is the default.
$rgName = "weu-afs-mvp-rg"
$storageName = "storageaccountname"
$shareName = "fileshare-hot-tier01"
az storage share-rm create `
    --resource-group $rgName `
    --storage-account $storageName `
    --name $shareName `
    --access-tier Hot `
    --quota 100

How To Lower Your Azure File Shares Cost With Hot and Cool Tiers 8

#! Creating file share with Cool Tier with Azure CLI
#! Please note that if you don't specify the --quota size, the default file share size will be created with 5Tib.
#! Please note that if you don't specify the Access Tier, then TransactionOptimized is the default.
$rgName = "weu-afs-mvp-rg"
$storageName = "storageaccountname"
$shareName = "fileshare-cool-tier01"
az storage share-rm create `
    --resource-group $rgName `
    --storage-account $storageName `
    --name $shareName `
    --access-tier Cool `
    --quota 100

How To Lower Your Azure File Shares Cost With Hot and Cool Tiers 9

#! Creating file share with Transaction Optimized Tier (formerly called Standard) with Azure CLI
#! Please note that if you don't specify the --quota size, the default file share size will be created with 5Tib.
$rgName = "weu-afs-mvp-rg"
$storageName = "storageaccountname"
$shareName = "fileshare-txo-tier01"
az storage share-rm create `
    --resource-group $rgName `
    --storage-account $storageName `
    --name $shareName `
    --access-tier TransactionOptimized `
    --quota 100

How To Lower Your Azure File Shares Cost With Hot and Cool Tiers 10

Finally, to list the existing file shares with Azure CLI and see their Access Tiers, you can run the following command:

$storageName = "storageaccountname"
az storage share-rm list --storage-account $storageName

Create a hot and cool tier in the Azure Portal

Now if you prefer to use the Azure Portal, you can also do the same and create the desired tiers.

Login to the Azure Portal with contributor access, select the desired storage account and then browse to File shares under File service. Click (+) to create a new file share with the desired Tiers as shown in the figure below.

How To Lower Your Azure File Shares Cost With Hot and Cool Tiers 11

Once the new tiers are created, you can see all the file shares with their respective storage tiers as shown in the figure below. At the time of this writing, you cannot move/update file share(s) between different tiers through the Azure Portal yet. You need use PowerShell or Azure CLI (more on this below).

How To Lower Your Azure File Shares Cost With Hot and Cool Tiers 12

Moving existing file shares between storage tiers

What if you have an existing file share created before the Hot and Cool tiers are available. Can you change the access tier and move between different tiers? The answer is YES!

In this example, I have existing file shares created with Transaction Optimized tier (formerly called Standard). I will downgrade the tier to Hot by running the following PowerShell command:

#! Updating existing file shares tier with PowerShell
#! This command will update all file shares from TransactionOptimized ==> Hot
$rgName = "weu-afs-mvp-rg"
$storageName = "storageaccountname"
Get-AzRmStorageShare -ResourceGroupName $rgName `
     -StorageAccountName $storageName | `
     ?{$_.AccessTier -eq "TransactionOptimized"} | `
     Update-AzRmStorageShare -AccessTier Hot

How To Lower Your Azure File Shares Cost With Hot and Cool Tiers 13

Similarly, you can move from Hot to Cool and vice versa (upgrade from Cool to Hot).

#! Updating existing file shares tier with PowerShell
#! This command will update all file shares from Hot ==> Cool
$rgName = "weu-afs-mvp-rg"
$storageName = "storageaccountname"
Get-AzRmStorageShare -ResourceGroupName $rgName `
     -StorageAccountName $storageName | `
     ?{$_.AccessTier -eq "Hot"} | `
     Update-AzRmStorageShare -AccessTier Cool

At the time of this writing, Azure CLI is not yet available to update/move existing tiers since the –access-tier argument is still in preview. I expect Azure CLI will be updated soon. You can use the following Azure CLI command to move a file share to a specific tier:

#! Updating existing file share tier with Azure CLI
#! This command will update a single file share from Hot ==> Cool
$rgName = "weu-afs-mvp-rg"
$storageName = "storageaccountname"
$shareName = "fileshare-hot-tier01"
az storage share-rm update `
    --resource-group $rgName `
    --storage-account $storageName `
    --name $shareName `
    --access-tier Cool 

Change storage tier in the Azure Portal

Now if you prefer to use the Azure Portal, you can also do the same and change the storage tier for the desired file share.

Login to the Azure Portal with contributor access, select your storage account and then browse to File shares under File service.

Select the desired file share and then click ‘Change tier‘ as shown in the figure below.

How To Lower Your Azure File Shares Cost With Hot and Cool Tiers 14

Next, choose your desired Tier (Transaction optimized, Hot, or Cool) and click Apply.

How To Lower Your Azure File Shares Cost With Hot and Cool Tiers 15

That’s there you have it!

Pricing

From a pricing point of view, the new pricing page is fully updated. You can check it here and see the price based on your preferred region and currency.

Please note that premium file shares are only available in a provisioned billing model. For more information on the premium file shares, see understanding premium file shares for Azure File Sync. On the other hand, standard file shares, including (transaction optimized, hot, and cool) file shares, are available in a pay as you go, model.

Additionally, for both SMB and REST API operations, transaction costs are incurred against your Azure file share for standard file shares, including (transaction optimized, hot, and cool) tiers, covering operations such as enumerating a directory or reading a file. These prices vary based on the redundancy (LRS/GRS/ZRS) option you select.

Summary

In this article, I shared with you what is the difference between the four tiers, then I showed you how to create hot and cool file shares using Azure CLI and PowerShell, and finally, I showed you how to update and move existing file share to different tier so you can optimize your workload and reduce storage costs.

The access tier determines the price and in some cases also the performance of a file share. Premium file shares are not available when the storage is created with standard performance. You need to create a premium file storage account for those. The main differentiation of the remaining tiers is the cost for storage at rest and transaction.

I recommend starting with Hot tier for Azure File Sync and then adjust based on your workload needs. Azure Files and Azure File Sync give you the ability to share files without the need to deploy the underlying server infrastructure provides several benefits when building an Azure-based application.

What about Azure Portal’s support to create and manage the new tiers? Stay tuned!!!

__
Thank you for reading my blog.

If you have any questions or feedback, please leave a comment.

-Charbel Nemnom-

Related Posts

About Charbel Nemnom 579 Articles
Charbel Nemnom is a Cloud Architect, Swiss Certified ICT Security Expert, Microsoft Most Valuable Professional (MVP), and Microsoft Certified Trainer (MCT), totally fan of the latest's IT platform solutions, accomplished hands-on technical professional with over 17 years of broad IT Infrastructure experience serving on and guiding technical teams to optimize the performance of mission-critical enterprise systems. Excellent communicator is adept at identifying business needs and bridging the gap between functional groups and technology to foster targeted and innovative IT project development. Well respected by peers through demonstrating passion for technology and performance improvement. Extensive practical knowledge of complex systems builds, network design, business continuity, and cloud security.

Be the first to comment

Leave a Reply

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