Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3k forks source link

az network firewall policy rule-collection-group collection add-filter-collection returns a 'Bad Request' #24493

Open plynch66 opened 2 years ago

plynch66 commented 2 years ago

Hi,

I can create an empty Network Rule Collection within a Rule Collection Group using the Azure Portal but if I try the same action using the Azure CLI the command fails .

The detailed error message is :

"statusMessage": "{\"Message\":\"The request is invalid.\",\"ModelState\":{\"resource\":[\"{\\"Status\\":\\"Failed\\",\\"Error\\":{\\"Code\\":\\"FirewallPolicyRuleIpAddressesAndPortsMustBeSpecified\\",\\"Message\\":\\"Firewall Policy Rule should have IP addresses and ports specified. * is used to match all.\\",\\"Target\\":null}}\"]}}"

The documentation states that the only required parameters are : --collection-priority --name --policy-name --rule-collection-group-name --resource-group

However, the Azure Portal requires you to specify an action (either Allow or Deny) when completing this task. The Portal also allows you to create an empty rule collection without adding any rules at creation time but I am unable to do this using the AZ CLI.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

yonzhan commented 2 years ago

@necusjz for awareness