az cdn endpoint rule add does not parse match-values correctly
See original GitHub issueThis is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az cdn endpoint rule add
Errors:
(BadRequest) Rules validation failed. More information: Value {} is not a valid IP Address in rule iprestriction.
Code: BadRequest
Message: Rules validation failed. More information: Value {} is not a valid IP Address in rule iprestriction.
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- Create a CDN profile and endpoint. I am using Premium Verizon.
az cdn endpoint rule add -g {} -n {} --profile-name {} --order 1 --rule-name iprestriction --match-variable RemoteAddress --operator IPMatch --negate-condition true --match-values 1.2.3.4/32,5.6.7.8/32 --action-name UrlRedirect --redirect-type PermanentRedirect --custom-path /403 --debug
Expected Behavior
Where the parameter passed to match-values is a comma separated list of IP addresses in CIDR notation, multiple values should be added to the rule’s match values (docs).
For example --match-values 1.2.3.4/32,5.6.7.8/32 should produce a rule that matches those two IP addresses.
Looking at the debug output, the request seems to combine the two IP addresses into a single, invalid string like
“matchValues”: [“1.2.3.4/32,5.6.7.8/32”]
Environment Summary
Linux-4.19.104-microsoft-standard-x86_64-with-debian-buster-sid, Ubuntu 18.04.4 LTS
Python 3.6.10
Installer: DEB
azure-cli 2.33.1
Extensions:
azure-iot 0.13.0
Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0
Additional Context
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
az cdn endpoint rule | Microsoft Learn
Manage delivery rules for an endpoint. In this article. Commands; az cdn endpoint rule add; az cdn endpoint rule remove; az cdn endpoint...
Read more >What is the correct Azure CLI command for creating HTTP ...
UPDATE 2: The following Azure help page suggests az cdn endpoint rule action add is correct, but it still doesn't work (provides cryptic...
Read more >azure-cli 2.23.0 - PyPI
az cdn endpoint rule add : Fix delivery rule creation for non-Microsoft SKU (#17822) ... Fix #12291: az storage blob generate-sas does not...
Read more >Configuring Clusters OpenShift Container Platform 3.11
Another method to access the metrics is to use a cluster role. You still need to enable the endpoint, but you do not...
Read more >Chrome Enterprise Lab - Schema
The autoscaler can add instances but not remove any. ... Cloud CDN will not apply any default negative caching when a policy exists....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@chris-hibberd, CLI’s collection property like --match-values use the space as the separator. You command should go like:
The commands works as expected per my test:
@yonzhan I could see some different error however I could see that IP addresses are passed as single string and thus redirecting this to services team.