azure-cli: AttributeError: 'NetworkProfile' object has no attribute

Hi,

I am trying to create an ACI in a VNet in West Europe (a supported region for this scenario) and on the first run I see the following error message.

If I run the command a second time it succeeds.

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az container create

Errors:

'NetworkProfile' object has no attribute 'result'
Traceback (most recent call last):
Local\Temp\pip-unpacked-wheel-rpp6y7vh\knack\cli.py, ln 215, in invoke
azure\cli\core\commands\__init__.py, ln 659, in execute
azure\cli\core\commands\__init__.py, ln 722, in _run_jobs_serially
azure\cli\core\commands\__init__.py, ln 715, in _run_job
AppData\Local\Temp\pip-unpacked-wheel-igh1xymj\six.py, ln 703, in reraise
azure\cli\core\commands\__init__.py, ln 693, in _run_job
azure\cli\core\commands\__init__.py, ln 330, in __call__
pip-unpacked-wheel-34tyr6f2\azure\cli\core\__init__.py, ln 784, in default_command_handler
azure\cli\command_modules\container\custom.py, ln 190, in create_container
azure\cli\command_modules\container\custom.py, ln 348, in _get_vnet_network_profile
AttributeError: 'NetworkProfile' object has no attribute 'result'

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 container create --resource-group {} --name {} --image {} --vnet {} --subnet {}

Expected Behavior

Environment Summary

Windows-10-10.0.19041-SP0
Python 3.6.8
Installer: MSI

azure-cli 2.17.1

Extensions:
aks-preview 0.4.71

Additional Context

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 19 (3 by maintainers)

Most upvoted comments

We got the same error, any news from Microsoft?

I experience the same behavior as @czmirek for both West Europe and North Switzerland.

Slightly different output than @plynch66:

ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: 'NetworkProfile' object has no attribute 'result'
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 660, in execute
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 723, 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 716, in _run_job
    six.reraise(*sys.exc_info())
  File "/opt/az/lib/python3.6/site-packages/six.py", line 703, in reraise
    raise value
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 694, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 331, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 808, in default_command_handler
    return op(**command_args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/container/custom.py", line 190, in create_container
    network_profile = _get_vnet_network_profile(cmd, location, resource_group_name, vnet, vnet_address_prefix, subnet, subnet_address_prefix)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/container/custom.py", line 348, in _get_vnet_network_profile
    network_profile = ncf.network_profiles.create_or_update(resource_group_name, default_network_profile_name, network_profile).result()
AttributeError: 'NetworkProfile' object has no attribute 'result'

@Peder2911 , what version of azure CLI did you use?

container instance service team should look into this issue.

Same behavior on West Europe. This is the output:

ERROR: The command failed with an unexpected error. Here is the traceback: ERROR: ‘NetworkProfile’ object has no attribute ‘result’ Traceback (most recent call last): File “/opt/az/lib/python3.6/site-packages/knack/cli.py”, line 233, in invoke cmd_result = self.invocation.execute(args) File “/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py”, line 660, in execute raise ex File “/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py”, line 723, 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 716, in _run_job six.reraise(*sys.exc_info()) File “/opt/az/lib/python3.6/site-packages/six.py”, line 703, in reraise raise value File “/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py”, line 694, in _run_job result = cmd_copy(params) File “/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py”, line 331, in call return self.handler(*args, **kwargs) File “/opt/az/lib/python3.6/site-packages/azure/cli/core/init.py”, line 808, in default_command_handler return op(**command_args) File “/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/container/custom.py”, line 190, in create_container network_profile = _get_vnet_network_profile(cmd, location, resource_group_name, vnet, vnet_address_prefix, subnet, subnet_address_prefix) File “/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/container/custom.py”, line 348, in _get_vnet_network_profile network_profile = ncf.network_profiles.create_or_update(resource_group_name, default_network_profile_name, network_profile).result() AttributeError: ‘NetworkProfile’ object has no attribute ‘result’