Hello kan jag,
Thank you for posting your query here!
Adding on to the previous comment, with Azure Monitor for Virtual Machines, you can either do it in KQL with a query in the text below, using Azure Monitor for Virtual Machines Guest Health
InsightsMetrics
| where Computer in (
"DC10.na.contosohotels.com" // Windows
)
| where Namespace == "LogicalDisk"
| where Name == "FreeSpacePercentage"
| extend Disk=tostring(todynamic(Tags)["vm.azm.ms/mountId"])
| summarize arg_max(TimeGenerated, *) by Disk, Computer
| project TimeGenerated, Disk, Computer, Val
| where Val > 90 //To setup the alert when disk utilization has reached 90%
You can add more filters if needed and specify thresholds in Azure Monitor alerts rather than in KQL.
Also, there is another way to do it in portal using below:
1. Portal -> Virtual Machines
2. Click on the "Disks" option in the left-hand menu.
3. Select the disk you want to set the alert for.
4. Click on the "Alerts" option and select New Alert.
5. In the "Create rule" page, fill in the required info and under the "Condition" section, choose "Add metric condition and select the "Metric" you want to create an alert on. For example, select "Percentage used".
6. Choose the appropriate "Aggregation type" and "Time window" for the metric.
7. Set the "Threshold" type to "Static" and define a "Threshold value" of 90%.
8. Click on the "Add action group" button to add an action group to the alert.
9. Fill in the "Action group details"
10. Configure an "Email/SMS/Push/Voice" action type.
11. Click on the "Create alert rule" button to create the alert.
For further reference:
https://learn.microsoft.com/en-us/answers/questions/1332871/how-to-setup-azure-alert-when-disk-space-is-90-for
https://techcommunity.microsoft.com/t5/azure-observability/i-want-see-an-alert-when-my-disk-space-less-than-5gb-in-virtual/m-p/2210373
Kindly let us know if you have any further queries. I’m happy to assist you further.
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.