-You can use the Get-AzMetricDefinition cmdlet to view the list of all metrics available for a specific resource like your VM, as described here
-Metric alert rules have dedicated PowerShell cmdlets available here:
Add-AzMetricAlertRuleV2: Create a new metric alert rule or update an existing one.
Get-AzMetricAlertRuleV2: Get one or more metric alert rules.
Remove-AzMetricAlertRuleV2: Delete a metric alert rule.
You will find these resources helpful:
-Managing log alerts using PowerShell
https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-log#managing-log-alerts-using-powershell
-Create, view, and manage activity log alerts by using Azure Monitor
https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-activity-log#powershell
-FAQs on VM insights:
Why are metrics from the guest OS of my Azure virtual machine not showing up in Metrics explorer?
Platform metrics are collected automatically for Azure resources. You must perform some configuration though to collect metrics from the guest OS of a virtual machine. For a Windows VM, install the diagnostic extension and configure the Azure Monitor sink as described in Install and configure Windows Azure diagnostics extension (WAD). For Linux, install the Telegraf agent as described in Collect custom metrics for a Linux VM with the InfluxData Telegraf agent.
More FAQs here: https://learn.microsoft.com/en-us/azure/azure-monitor/faq#vm-insights
-Metrics for the guest operating system (guest OS) which runs in Azure Virtual Machines, Service Fabric, and Cloud Services are NOT listed here. Guest OS metrics must be collected through the one or more agents which run on or as part of the guest operating system. Guest OS metrics include performance counters which track guest CPU percentage or memory usage, both of which are frequently used for auto-scaling or alerting.
Host OS metrics ARE available and listed in this document. They are not the same. The Host OS metrics relate to the Hyper-V session hosting your guest OS session.
-Supported metrics with Azure Monitor for Virtual machines can be found here
Please let me know if you have further questions.
----------
Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer.