Azure / azure-cli-extensions

Public Repository for Extensions of Azure CLI.
https://docs.microsoft.com/en-us/cli/azure
MIT License
384 stars 1.25k forks source link

Unable to add management IP to Azure Firewall instance #4765

Open kehao-chen opened 2 years ago

kehao-chen commented 2 years ago

This is autogenerated. Please review and update as needed.

Describe the bug

I would like to enable forced tunneling on Azure Firewall via Azure CLI.

Command Name az network firewall management-ip-config update Extension Name: azure-firewall. Version: 0.13.0.

Errors:

The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'public_ip_address'
Traceback (most recent call last):
  File "/opt/az/lib/python3.8/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute
    raise ex
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/command_operation.py", line 200, in handler
    instance = custom_function(instance=instance, **custom_func_args)
  File "/home/k/.azure/cliextensions/azure-firewall/azext_firewall/custom.py", line 249, in update_af_management_ip_configuration
    instance.management_ip_configuration.public_ip_address = SubResource(id=public_ip_address)
AttributeError: 'NoneType' object has no attribute 'public_ip_address'

To Reproduce:

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

Expected Behavior

I could create an Azure Firewall instance with forced tunneling enabled via Azure CLI.

Environment Summary

Linux-5.4.0-1077-azure-x86_64-with-glibc2.28 (Cloud Shell), Common Base Linux Delridge (quinault)
Python 3.8.13
Installer: DEB

azure-cli 2.36.0

Extensions:
azure-firewall 0.13.0
ai-examples 0.2.5
ssh 1.1.0

Dependencies:
msal 1.17.0
azure-mgmt-resource 20.0.0

Additional Context

None

yonzhan commented 2 years ago

network

YuanyuanNi commented 2 years ago

Hi: @kehao-chen 'management-ip-config' should be created before using update command, but now it has something wrong with creating function, for more information,pls refer: https://github.com/Azure/azure-cli-extensions/issues/1270. Best wishes.