Azure / azure-cli

Azure Command-Line Interface
MIT License
4k stars 2.98k forks source link

az-network-application-gateway-waf-policy-custom-rule-create : matchConditions should not be optional and must be not empty #30043

Open yanivsag opened 2 weeks ago

yanivsag commented 2 weeks ago

Describe the bug

according to https://learn.microsoft.com/en-us/cli/azure/network/application-gateway/waf-policy/custom-rule?view=azure-cli-latest&tryIt=true&source=docs#az-network-application-gateway-waf-policy-custom-rule-create

the matchConditions parameter is optional and can contain an empty list while it is not.

Related command

az network application-gateway waf-policy custom-rule create

Errors

not providing match conditions will result in validation error

Issue script & Debug output

az network application-gateway waf-policy custom-rule create --action Allow --name test --policy-name test --priority 100 --resource-group AZFW-SME-RG --rule-type MatchRule

(ApplicationGatewayFirewallCustomRuleInvalidPriority) Custom Rule 'test' does not have a match condition defined in context 'properties.customRules[0]'. Code: ApplicationGatewayFirewallCustomRuleNoMatchConditionNotSupported Message: Custom Rule 'test' does not have a match condition defined in context 'properties.customRules[0]'.

Expected behavior

the command itself is OK, the problem is with the help hint and documentation

Environment Summary

$ az version { "azure-cli": "2.65.0", "azure-cli-core": "2.65.0", "azure-cli-telemetry": "1.1.0", "extensions": { "ai-examples": "0.2.5", "ml": "2.30.1", "ssh": "2.0.5" } }

Additional context

No response

yonzhan commented 2 weeks ago

Thank you for opening this issue, we will look into it.