'Azure alert configuration using powershell

I'm trying to configure azure alerts based on a custom log search using PowerShell. However, I'm not able to do that can someone help me with that.

I tried using New-AzMetricAlertRuleV2Criteria and New-AzMetricAlertRuleV2DimensionSelection.

I want to Configure an Alert using powershell script with Log Analytics Query.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source