Azure / Azure/azure-powershell
How to add an alert to the IoT hub?
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
Hi guys,
I am trying to add an alert rule to the IoT hub via powershell by executing:
Add-AzureRMMetricAlertRule -Name test -Location "West Europe" -ResourceGroup $rg `
-Operator GreaterThan -Threshold 2 -WindowSize 00:05:00`
-TargetResourceId /subscriptions/[my id here]/resourceGroups/[my rg here]/providers/Microsoft.Devices/IotHubs/[iothub name here] `
-MetricName "c2d.commands.egress.reject.success" -Description "Test Alert" -TimeAggre Total
But it returns **InvalidArgument: The property 'resourceId' has an invalid value**. I can't add the alert via Azure portal as well because the button is hidden (Operation monitoring enabled).
Contributor guide
Assessment
This issue has not been assessed yet.