question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'az network front-door rules-engine rule condition add' command fails for GeoMatch with Country List

See original GitHub issue

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Related command az network front-door rules-engine rule condition add -f $Name -g $ResourceGroup --rules-engine-name $RulesEngineName –name $RuleName --match-variable RemoteAddr –operator GeoMatch --match-values ["AT", "BE", "BG", "HR", "CY", "CZ", "DK", "EE", "FI", "FR"] –negate-condition false

Describe the bug ERROR: (BadRequest) Rules Engines validation failed. More information: AT BE BG HR CY CZ DK EE FI FR are not supported country codes… Code: BadRequest Message: Rules Engines validation failed. More information: AT BE BG HR CY CZ DK EE FI FR are not supported country codes…

To Reproduce Execute rule condition add command with multiple country codes as match-values. az network front-door rules-engine rule condition add -f $Name -g $ResourceGroup --rules-engine-name $RulesEngineName –name $RuleName --match-variable RemoteAddr –operator GeoMatch --match-values ["AT", "BE", "BG", "HR", "CY", "CZ", "DK", "EE", "FI", "FR"] –negate-condition false

Expected behavior Front door rule with geo match condition with multiple countries should be created.

Environment summary azure-cli 2.40.0

core 2.40.0 telemetry 1.0.8

Extensions: azure-devops 0.25.0

Dependencies: msal 1.18.0b1 azure-mgmt-resource 21.1.0b1

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
t-bzhancommented, Oct 13, 2022

@adsathye , that might be related to https://github.com/Azure/azure-cli/issues/23797#issuecomment-1238997338, Azure CLI has made some changes in 2.40.0 regarding to passing PowerShell arrays as multiple values argument to CLI.

1reaction
t-bzhancommented, Oct 12, 2022

Hi @adsathye , it seems that you are not using the correct way to pass in multiple-value arguments. You are suggested to use space-separated list of values for --match-values: image

Instead of using:

az network front-door rules-engine rule condition add -f $Name -g $ResourceGroup --rules-engine-name $RulesEngineName –name $RuleName --match-variable RemoteAddr –operator GeoMatch --match-values [“AT”, “BE”, “BG”, “HR”, “CY”, “CZ”, “DK”, “EE”, “FI”, “FR”] –negate-condition false

Could you try:

az network front-door rules-engine rule condition add -f $Name -g $ResourceGroup --rules-engine-name $RulesEngineName –name $RuleName --match-variable RemoteAddr –operator GeoMatch --match-values “AT” “BE” “BG” “HR” “CY” “CZ” “DK” “EE” “FI” “FR” –negate-condition false

Or using the splatting to pass list as multiple arguments like below

$regions = @(“AT”, “BE”, “BG”, “HR”, “CY”, “CZ”, “DK”, “EE”, “FI”, “FR”) az network front-door rules-engine rule condition add -f $Name -g $ResourceGroup --rules-engine-name $RulesEngineName –name $RuleName --match-variable RemoteAddr –operator GeoMatch --match-values @regions –negate-condition false

Read more comments on GitHub >

github_iconTop Results From Across the Web

az network front-door rules-engine rule condition
Manage Rules Engine match conditions for Front Door. In this article. Commands; az network front-door rules-engine rule condition add; az network front-door ......
Read more >
RulesEngine | A Json based Rules Engine with extensive ...
RulesEngine is a highly extensible library to build rule based system using ... //Get list of workflow rules declared in the json var...
Read more >
Identify Users from Different Countries and Regions for ...
Custom Rule Engine. Go to "Rules engine configuration" in Front Door blade. Click "Add". Give it a name, e.g. in my ...
Read more >
How can I use an Azure Front Door Rules Engine match ...
The "Request Path" match condition appears to match on the path after the initial / , for example given a request for:
Read more >
Azure - Update Network Security Group Rule with my IP Address
For sensitive ports such as SSH and RDP, similar rules are the only ones that allow such access. I never allow the entire...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found