Vowneee
Vowneee

Reputation: 1479

how to validate the Azure CLI or az command before execute?

Looking for a way to validate the AZ command result before the actual implementation.

Below is the command I want to test, The requirement is that, i need to validate the result before applying the command. I know this is possible in ARM template deployment, but is it not allowed in AzureCLI ?

az monitor metrics alert condition create --aggregation {Average, Count, Maximum, Minimum, Total}
                                          --metric
                                          --op {Equals, GreaterOrLessThan, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, NotEquals}
                                          --type {dynamic, static}
                                          [--dimension]
                                          [--namespace]
                                          [--num-periods]
                                          [--num-violations]
                                          [--sensitivity {High, Low, Medium}]
                                          [--since]
                                          [--skip-metric-validation {false, true}]
                                          [--subscription]
                                          [--threshold]

Upvotes: 0

Views: 1408

Answers (1)

AjayKumarGhose
AjayKumarGhose

Reputation: 4893

AFAIK, Whatif is only available for az group or subscription deployment and it cant be used in a single line or direct mode az commands.

  • There is debug option in other az cmd but i don't think it will serve your purpose.

For more information please refer the below links:

Upvotes: 2

Related Questions