0
votes

I want to create the AppInsights with Availability test (WebTest), and attach email alert rule to it using Azure Powershell. And I'd like to attach the already existing ActionGroup with needed email addresses to the alert rule.

According to latest Add-AzWebtestAlertRule method documentation, there is no ActionGroup parameter. However, in Azure portal we can attach the existing action group to the WebTest alert rule. The Add-AzWebtestAlertRule has only the "Action" property which is of type List1[Microsoft.Azure.Management.Monitor.Management.Models.RuleAction]>]`, but it's not clear how to use that one.

Also, if take a look at Add-AzMetricAlertRuleV2, it does have the ActionGroup property and so we can attach action group to it.

So this is the confusion why one method has ActionGroup prop, and another one that seems similar, does not. Maybe there is a way to use the "Action" property to attach action group, but it's not clear how.

1

1 Answers

0
votes

According to my research, the command Add-AzWebtestAlertRule provides the property action . Its type is List`1[Microsoft.Azure.Management.Monitor.Management.Models.RuleAction]. We can use the property to ensure which action we do after meeting the rule condition. For more details, please refer to the document. enter image description here