How To Create an Alert For Azure File Sync When The File Share Reach a Certain Level

| ,

Published on | Updated on September 9, 2019

3 Min. Read

Introduction

Azure File Sync can help you centralize your files in Azure and then install a sync agent on Windows Server whether it’s on-premises or in Azure (IaaS VM) to provide fast local access to your files. Your Windows Server and Azure Files are constantly in sync, so you have one centralized location for your files with multi-site access powered by fast local cache and cloud tiering.

The cloud tiering feature enables frequently accessed files to be cached locally such that the full file content is present on the server, whereas less frequently accessed files are tiered to the cloud. The tiered files (AFS reparse points) will be recalled on-demand when a user or application accesses it on the local server.

To learn more about Azure File Sync, please check my previous articles here.

Now you enabled Azure File Sync and everything is running well, but like for every solution you deploy, you need to monitor its health status, data synchronization, activity logs, etc. I wrote two articles on how to monitor Azure File Sync, I highly encourage you to check them out:

Assuming you have a fairly large Azure File Sync environment. The storage account contains 10 File shares, each 5TB in size. Wouldn’t be nice to set up an alert to get informed when any of the file shares are more than a certain capacity.

In this quick article, I will show you how to create a custom alert so you can be notified when the File Share capacity reaches a certain level.

Create a Custom Alert

Open the Azure portal, click All services found in the upper left-hand corner. In the list of resources, type Monitor. As you begin typing, the list filters based on your input. Select Monitor.

Select Alerts, and then click +New alert rule.

How To Create an Alert For Azure File Sync When The File Share Reach a Certain Level 1

In the Create rule blade, Select RESOURCE. Choose your subscription, then filter by resource type and select the Storage services where the File Share for Azure File Sync is hosted, and then select the resource <storageaccountname/file>. Click Done.

How To Create an Alert For Azure File Sync When The File Share Reach a Certain Level 2

Click Add under CONDITION, and select Used capacity metric. Then under Dimension Name – File Share – SELECT *

How To Create an Alert For Azure File Sync When The File Share Reach a Certain Level 3

Under Alert logic, set the following threshold:

  • Operator: Greater than or equal to
  • Aggregation Type: Average
  • Threshold value: Bytes

In this example, I will set the threshold value to 1 gigabyte = 1073741824 bytes.

Then set evaluated based on 1-hour aggregation granularity, and frequency of evaluation every 5 minutes. Click Done.

How To Create an Alert For Azure File Sync When The File Share Reach a Certain Level 4

Under ACTIONS, select an existing action group or create a new one.

How To Create an Alert For Azure File Sync When The File Share Reach a Certain Level 5

Last, under ALERT DETAILS, give the alert a meaningful name, description and severity type, and finally click Create alert rule.

Now once the File Share capacity reaches the specified value, you will receive an email alert similar to the one below:

How To Create an Alert For Azure File Sync When The File Share Reach a Certain Level 6

If we switch back to the Azure Portal, we can see that the File Capacity is above the 1GB of the threshold that we set above.

How To Create an Alert For Azure File Sync When The File Share Reach a Certain Level 7

Please note that as of writing this article, the file share capacity metric for standard file share is currently available at the storage account level and not per-share. What this means is, if you want to create an alert for a file share with the standard storage account, then you have to create one file share per standard storage account, otherwise you have to use the premium File Storage account. The Per-share capacity metric is currently only available for premium file shares. So when you create the condition for the alert with a premium account, you will see all the file shares created under that account as shown in the following screenshot. However with standard storage account, you will see any instead of a particular file share.

How To Create an Alert For Azure File Sync When The File Share Reach a Certain Level 8

So until Microsoft support per-share capacity metric for a standard file share, you have to create one file share per standard storage account to monitor it’s capacity as described in this article.

That’s it there you have it! Happy monitoring with Azure File Sync :)

Summary

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

  • Multi-site access – provide write access to the same data across Windows servers and Azure Files.
  • Cloud tiering – store only recently accessed data on local servers.
  • Integrates with Azure backup – no need to back up your data on-premises.
  • Fast disaster recovery – restore file metadata immediately and recall data as needed.

I hope you find this guide useful. To learn more about Azure File Sync, please check the following articles.

__
Thank you for reading my blog.

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

-Charbel Nemnom-

Previous

Stop Using Failover Cluster Manager With Azure Stack HCI

Announcing The Microsoft Cloud Virtual Summit 2019 #Microsoft #Azure

Next

Leave a comment below...

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

Subscribe to Charbel Nemnom’s Blog

Get the latest posts delivered right to your inbox

The content of this website is copyrighted from being plagiarized! However, you can copy from the 'Code Blocks'.

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

Thank you for visiting!