I'm keeping an eye on an Azure Windows VM through a metric called Available Memory Bytes. I've set it up to trigger alerts if the available memory drops below 3 GB, but I've run into an issue: every time the VM gets deallocated or is booting up, Azure Monitor reports 0 for this metric and triggers a false alert. This seems unfair since the VM isn't actually running low on memory; it's just offline. So, how can I stop or manage these false-positive alerts for VMs that are stopped or starting? Is there a recommended practice for metrics that show 0 when the VM isn't running?
2 Answers
You might want to set a condition that the VM's uptime should be over 300 seconds and its status must be 'running' before the alert kicks in. This way, it won't trigger when the VM is just starting or stopped. Plus, it can help filter out those pesky false alerts!
Instead of building a complicated solution like using a Function App or Logic App, you could try implementing Alert Processing Rules. They can suppress alerts based on schedules, but keep in mind this might be tougher to manage if you have a lot of VMs being powered up and down automatically.

Totally! It's such a frustrating bug, right? I had a customer facing the same issue. Reporting it to Microsoft can be a hassle too. I wish there was an easier way to implement that uptime and running state into your alert system.