Azure NetApp Files is Microsoft’s enterprise shared file service (read more here). As a first party service is allows you to deploy private NFS & SMB storage to your VNETs in seconds. As it is a Microsoft first party service, it also allows you to easily monitor key metrics via the Azure Monitor.
I will run through an example below, where I create and set an alert on a 100GB volume that will raise an alert to my Azure app installed on my mobile device. I could quite easily change this to SMS, Email, Teams, Slack, etc and also specify automatic actions to take place (i.e. grow a volume).
Step 1: Create Azure Monitor Alert
In order to create an alert, you must have provisioned the ANF resources before these steps.
The PowerShell script is available on my repo here: https://github.com/kirkryan/anf-alerts
Azure Monitor is used to monitor and alert on any Azure resources. It can be configured via the portal or PowerShell commands, in this example we will be using PowerShell as the portal workflow is not yet enabled for creating a new alert for ANF.
Use the following PowerShell commands to create your alert:
$Resource = "enter your ResourceID here" $ResourceGroup = "enter your ResourceGroup here" $QuotaInBytes = 107374182400 (example for 100GB) az monitor metrics alert create --name "Volume Quota Exceeded" --condition "avg VolumeLogicalSize > $QuotaInBytes" -g $ResourceGroup --scopes $Resource --description "Volume Quota Exceeded" -o table
HandyTip: You’ll notice that you must specify the capacity in bytes – here is a handy GiB to Bytes calculator: http://extraconversion.com/data-storage/gibibytes/gibibytes-to-bytes.html
Step 2: Configure Action Group
Now that you have successfully create a rule, you more than likely would like to perform an action when that rule is triggered. Navigate to the Azure monitor and select “Manage Alert Rules”. You will be shown a list of all existing rules. Select the name of the rule you would like to configure the action for to open the configuration screen below:
Next, select “Create action group” to configure a new action or “Select action group” if you already have an existing action.
Select the appropriate action type that you would like the rule to perform once activated. In this example I have used Email/SMS/Push/Voice and have configured the rule to push an alert to the Azure App on my mobile phone.
And that’s it! You’ve successfully configured alerting for your ANF volumes in just a few simple steps!
Any time your alerting thresholds are breached you will be automatically notified via your chosen action.
Here is an example of the push notification via the Azure mobile app: