azure-cli
azure-cli copied to clipboard
Time aggregation must be one of [Count]
I'm trying to create an alert on my app insights but getting the error message, "Time aggregation must be one of [Count]"
Here's my command.
az monitor metrics alert create -n "Failed Requests" -g $rgName --scopes $appInsightsId --condition "avg requests/failed > 50" --window-size 5m --evaluation-frequency 1m --description "Failed Requests"
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: d97968df-72c9-e50c-d5b1-54562c1bdef7
- Version Independent ID: 0cde4f15-6464-3106-b787-3ee37c7de0ee
- Content: az monitor metrics alert
- Content Source: src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/_help.py
- Service: monitoring-and-diagnostics
- GitHub Login: @rloutlaw
- Microsoft Alias: routlaw
Your condition needs to be --condition "count requests/failed > 50"
However, that will fail. I will submit a PR that will permit this for the upcoming release (next Tuesday)