Exclude File Types from Cloud Tiering in Azure File Sync

5 Min. Read

Azure File Sync helps you save on storage capacity by centralizing your files in Azure and then installing a sync agent on Windows Server on-premises or in Azure (IaaS VM) to provide fast local access to your cloud files. Your local server and Azure are constantly syncing, so you have one centralized location for your files with multi-site access powered by fast local caches and cloud tiering.

This article will show you how to exclude file types from cloud tiering in Azure File Sync so you can save on file recalls from the cloud.

Introduction

Cloud tiering is an optional feature of Azure File Sync in which frequently accessed files are cached locally on the server while all other files are tiered to Azure Files based on policy settings. When a file is tiered, the Azure File Sync file system filter (StorageSync.sys) replaces the file locally with a pointer, or reparse point. The reparse point represents a URL to the file in Azure Files.

When you enable cloud tiering, there are two policies that you can set to inform Azure File Sync when to tier cool files: the first one is volume-free space policy, and the second one is date policy. The volume-free space policy tells Azure File Sync to tier cool files to the cloud when a certain amount of space is taken up on your local disk. With the date policy, cool files are tiered to the cloud if they haven’t been accessed (read or written to) for X number of days. For more information about the cloud tiering capability, please check the official documentation from Microsoft.

When a user opens a tiered file, Azure File Sync seamlessly recalls the file data from Azure Files without the user needing to know that the file is actually stored in Azure.

Do you want to have two layers of cloud tiering? So you can configure for example, after 30 days move to Hot Tier, and if not used after 180 days move to Cold Tier. Please leave a comment below.

One of the most requested features by many users is to exclude file extensions (type) on a server endpoint from cloud tiering. Finally, Microsoft has enabled this capability starting with Azure File Sync agent version 13.0 and later. This new capability is a bit hidden, and in this article, I will show you how to exclude file extensions from cloud tiering for a server endpoint.

Prerequisites

To follow this article, you need to have the following:

1) Azure subscription. If you don’t have an Azure subscription, you can create a free one here.

2) Azure storage account – To create a general-purpose storage account, you can follow the instructions described here.

3) You need one or more file shares – You can follow the instructions described here to create an Azure file share.

4) Check the step-by-step guide on how to get started with Azure File Sync.

5) You need to have Azure File Sync agent version 13.0 or later release. You can download the latest AFS agent from here. In this example, we are running version 14.0.

Microsoft has added the “GhostingExclusionList” registry settings to exclude file types from cloud tiering.

Registry settings - Ghosting Exclusion List
Registry settings – Ghosting Exclusion List

Exclude file types from Cloud Tiering

Assuming you have all the prerequisites in place, log in to the server endpoint and take the following steps:

For example, to exclude the “.exe” extension from cloud tiering, run the following command from an elevated PowerShell window:

New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Azure\StorageSync" -Name "GhostingExclusionList" -Value ".exe"

For example, to exclude the “.pdf” extension from cloud tiering, run the following command from an elevated PowerShell window:

New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Azure\StorageSync" -Name "GhostingExclusionList" -Value ".pdf"

For example, to exclude two extensions from cloud tiering “.pdf” and “.exe“, run the following command from an elevated PowerShell window:

New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Azure\StorageSync" -Name "GhostingExclusionList" -Value ".exe|.pdf"

For example, to exclude multiple extensions from cloud tiering “.pdf“, “.exe” and “.msi“, run the following command from an elevated PowerShell window:

New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Azure\StorageSync" -Name "GhostingExclusionList" -Value ".exe|.pdf|.msi"

To check what file extensions did you exclude, run the following command from an elevated PowerShell window:

Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Azure\StorageSync" -Name "GhostingExclusionList"

For example, to update a file extension that you excluded to “.exe“, run the following command from an elevated PowerShell window:

Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Azure\StorageSync" -Name "GhostingExclusionList" -Value ".exe"

To delete a file extension that you excluded, run the following command from an elevated PowerShell window:

Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Azure\StorageSync" -Name "GhostingExclusionList"

In this example, we have excluded “.pdf” and “.exe” from cloud tiering.

Ghosting Exclusion List
Ghosting Exclusion List

Please note that you can exclude any file type extension you want.

Verify exclusions from Cloud Tiering

On the server endpoint, we have several files under the following path (F:\Users Docs) as shown in the figure below.

Server Endpoint Path
Server Endpoint Path

If we look at any file type “.pdf” or “.exe“, we will see the size is exactly the same size on disk. In this example, it’s 91.6 MB.

Exclude File Types from Cloud Tiering in Azure File Sync 1

For example, if we look at any other file type “.msi“, we will see the size on disk is 0 bytes which means it’s tiered to the cloud. To Check the file attributes on the file. Go to the Details tab, and then scroll down to the Attributes property. A tiered file has a different set of attributes you can check them here. The “O” attribute letter (Offline) indicates that some or all of the file’s content is not stored on the disk. When a file is fully recalled, Azure File Sync removes this attribute.

Exclude File Types from Cloud Tiering in Azure File Sync 2

You can also identify the tiered files by the new icon as a box on the side of the file in Windows 11 and Windows Server 2022. In this case, “.pdf” files are local, and “.xlsx” files are tiered to the cloud.

Exclude File Types from Cloud Tiering in Azure File Sync 3

From the Azure Portal experience, if we look under the Cloud Tiering section for the server endpoint, we can see 10 files not tiered as shown in the figure below.

Cloud Tiering - Azure Portal
Cloud Tiering – Azure Portal

If we look at the details of those files, we can see the Error “0x80C80285” with a Description “A file failed to be tiered” and file count equal to “10“. The error message is misleading since we excluded those files.

Files Not Tiering - Azure Portal
Files Not Tiering – Azure Portal

How many “.pdf” and “.exe” files do we have on the server endpoint path? 10 files. Microsoft should update the error message to identify the excluded files from cloud tiering.

(Get-ChildItem -Path 'F:\Users Docs\' -Include *.exe, *.pdf   -Recurse).count
File count excluded files
File count excluded files

That’s it there you have it!

Summary

In this article, we showed you how to exclude file types from cloud tiering so you can keep a specific set of files close to your users and save on recalls (download) from the cloud, and at the same time keep cloud tiering enabled on your server endpoint (volume path) to save on storage capacity.

Azure File Sync extends on-premises file servers into Azure by providing cloud benefits while maintaining performance and compatibility. Azure File Sync provides:

Do you want to learn more about Azure Storage including Azure Blobs and Azure File Shares? Make sure to check my recently published online course here: Azure Storage Essential Training.

We hope you find this guide useful.

__
Thank you for reading my blog.

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

-Charbel Nemnom-

Related Posts

Previous

Passing the Microsoft Sentinel Ninja Training

Access Azure File Share with SMB over QUIC

Next

Let me know what you think, or ask a question...

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

Subscribe to Stay in Touch

Never miss out on your favorite posts and our latest announcements!

The content of this website is copyrighted from being plagiarized!

You can copy from the 'Code Blocks' in 'Black' by selecting the Code.

Please send your feedback to the author using this form for any 'Code' you like.

Thank you for visiting!