azure-cli-extensions icon indicating copy to clipboard operation
azure-cli-extensions copied to clipboard

" az network firewall network-rule create" failed with an unexpected error

Open myers-dev opened this issue 2 years ago • 2 comments

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az network firewall network-rule create Extension Name: azure-firewall. Version: 0.11.0.

Errors:

The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 657, in execute
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 691, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/home/andrew/.azure/cliextensions/azure-firewall/azext_firewall/custom.py", line 391, in create_af_network_rule
    item_name, params, collection_params)
  File "/home/andrew/.azure/cliextensions/azure-firewall/azext_firewall/custom.py", line 344, in _upsert_af_rule
    collection_match = next((x for x in collection if x.name.lower() == collection_name.lower()), None)
TypeError: 'NoneType' object is not iterable

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...
  • az network firewall network-rule create --collection-name {} --destination-ports {} --firewall-name {} --name {} --protocols {} --resource-group {} --action {} --dest-addr {} --source-addresses {}

Expected Behavior

Environment Summary

Linux-5.10.60.1-microsoft-standard-WSL2-x86_64-with-debian-buster-sid
Python 3.6.10
Installer: DEB

azure-cli 2.26.1 *

Extensions:
azure-devops 0.20.0
azure-firewall 0.11.0
virtual-wan 0.2.11

Additional Context

myers-dev avatar Feb 09 '22 00:02 myers-dev

network

yonzhan avatar Feb 09 '22 02:02 yonzhan

Hi, @myers-dev , this command works well as below, and my CLI version is 2.37.0, maybe you can update to it and try again: az network firewall network-rule create --collection-name mycoll01 --source-addresses 10.0.0.0 111.1.0.0/24 --protocols UDP TCP ICMP --destination-fqdns www.bing.com --destination-ports 80 --firewall-name myfw --name myrule --protocols Any --resource-group nyy02 --priority 500 --action Allow image

Best wishes.

YuanyuanNi avatar Jun 22 '22 06:06 YuanyuanNi

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Sep 12 '22 08:09 ghost