Related command
az network application-gateway waf-policy custom-rule create \
--resource-group my-group \
--policy-name my-policy \
--name azuredevopsip \
--priority 10 \
--rule-type MatchRule \
--match-conditions '[{"variables": "RemoteAddr","operator":"IPMatch","values": ["'"$CURRENT_IP"'"]}]' \
--action Allow
Is your feature request related to a problem? Please describe.
When reading docs / looking at examples, I was not able to find any relevant information about how --match-conditions should be formatted.
When I ran this command I got the error Failed to parse '--match-conditions' argument: Model 'AAZObjectArg' has no field named 'RemoteAddr'
When running --match-conditions with ?? for docs it suggested variables [Required] Space-separated list of variables to use when matching. Variable values: RemoteAddr, RequestMethod, QueryString, PostArgs, RequestUri, RequestHeaders, RequestBody, RequestCookies. Try "??" to show more..
Documentation on azure-cli docs doesn't present any examples on --match-conditions.
Solution to this was to pass variables as an array of objects, where each key should have one of the values from RemoteAddr, RequestMethod, QueryString, PostArgs, RequestUri, RequestHeaders, RequestBody, RequestCookie.
Correct format:
--match-conditions '[{"variables":[{"variableName":"RemoteAddr"}],"operator":"IPMatch","values": ["'"$CURRENT_IP"'"]}]'
Describe the solution you'd like
The error message returned did not describe clear enough what the problem was, it suggested the variables key was not correct, but the docs referred to that it should be one of the RemoteAddr, RequestMethod, QueryString, PostArgs, RequestUri, RequestHeaders, RequestBody, RequestCookie.
Describe alternatives you've considered
Including example payloads of --match-conditions.
Additional context
Related command
Is your feature request related to a problem? Please describe.
When reading docs / looking at examples, I was not able to find any relevant information about how
--match-conditionsshould be formatted.When I ran this command I got the error
Failed to parse '--match-conditions' argument: Model 'AAZObjectArg' has no field named 'RemoteAddr'When running
--match-conditionswith??for docs it suggestedvariables [Required] Space-separated list of variables to use when matching. Variable values: RemoteAddr, RequestMethod, QueryString, PostArgs, RequestUri, RequestHeaders, RequestBody, RequestCookies. Try "??" to show more..Documentation on azure-cli docs doesn't present any examples on
--match-conditions.Solution to this was to pass variables as an array of objects, where each key should have one of the values from
RemoteAddr, RequestMethod, QueryString, PostArgs, RequestUri, RequestHeaders, RequestBody, RequestCookie.Correct format:
Describe the solution you'd like
The error message returned did not describe clear enough what the problem was, it suggested the variables key was not correct, but the docs referred to that it should be one of the
RemoteAddr, RequestMethod, QueryString, PostArgs, RequestUri, RequestHeaders, RequestBody, RequestCookie.Describe alternatives you've considered
Including example payloads of --match-conditions.
Additional context