Azure CLI needs --help ADDITIONS on how to properly form a condition file for creating a monitoring alert
Description
Outline the issue here:
I spent two days trying to figure this out. And Lucky for me Travis P. gave me a hand.
Please please put in MORE HELP in the
az monitor alert-rules create --help command.
What is needed:
- full example of command in real usage as here:
So just add to the --help this example:
az monitor alert-rules create -g 'Your_Monitoring_Group_NAME' --alert-rule-resource-name 'rule2' --name 'rule2' --condition @yourConditionFile --is-enabled true --location westus
and PLEASE PLEASE have Azure CLI 2.0.3 or later --help spit out this REQUIRED --condition file format:
{ "dataSource": { "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", "resourceUri": "/subscriptions/Your_Subscription_URL/Your_GROUP/providers/Microsoft.Compute/virtualMachines/your_VM", "metricName": "Percentage CPU", }, "odata.type": "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", "threshold" : 60, "operator": "GreaterThan", "windowSize" : "PT5M", "timeAggregation": "Average" }
This is documented NO WHERE. Not on git. not on Google. Not in msdn (really not). Not in Bing. not in the cli..
Please put this stuff directly in the CLI --help
Thanks!
It will save thousands of questions and problems down the road if this is added to Azure CLI 2.0 --help
Environment summary
Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here:
curl -L https://aka.ms/InstallAzureCli | bash
Then I had to put in the nightly.
Then I put in the curl -L https://aka.ms/InstallAzureCli | bash again
There is stuff like windowSize which is not in the public build yet but exists in Nightly
CLI Version: What version of the CLI and modules are installed? (Use az --version)
Answer here:
2.0.3
OS Version: What OS and version are you using?
Answer here:
macOS Sierra
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here:
C shell
Hi @jefffall I am working on the promised alert rule command revisions and I'd love your private feedback before I open a PR. Please email me at [email protected] if you get a chance and I'll send you some examples of the proposed changes.