Azure / azure-cli

Azure Command-Line Interface
MIT License
3.99k stars 2.96k forks source link

az managedapp show --name crash #18694

Open leongross opened 3 years ago

leongross commented 3 years ago

Describe the bug

Command Name az managedapp show

Errors:

The command failed with an unexpected error. Here is the traceback:
No value for given attribute
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 363, in handler
    show_exception_handler(ex)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/arm.py", line 417, in show_exception_handler
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 361, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/resource/custom.py", line 1356, in show_application
    return racf.applications.get(resource_group_name, application_name)
  File "/opt/az/lib/python3.6/site-packages/azure/mgmt/resource/managedapplications/operations/_applications_operations.py", line 79, in get
    'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
  File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 650, in url
    output = self.serialize_data(data, data_type, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 758, in serialize_data
    raise ValueError("No value for given attribute")
ValueError: No value for given attribute

To Reproduce:

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

Expected Behavior

Correct command output or report of failure, no crash

Environment Summary

Linux-5.4.0-1051-azure-x86_64-with-debian-buster-sid
Python 3.6.10
Installer: DEB

azure-cli 2.25.0

Additional Context

yonzhan commented 3 years ago

ARM

brsanche commented 1 year ago

+1 on this issue, any update?

leongross commented 1 year ago

apparently this is a stale

wu5bocheng commented 1 year ago

This bug is being fixed, the problem is currently located due to the missing --resouce-group parameter, you can temporarily fix the issue by adding --resource-group/-g {YourResourceGroupName}, please follow our follow-up reply for further updates.

brsanche commented 1 year ago

@wu5bocheng does that mean that I'll need to use --resource-group parameter for showing the managedapp info?

I can use the az managedapp show --ids without passing the --resource-group though.

wu5bocheng commented 1 year ago

@brsanche sure, you can use either --name combined with --resource-group or --ids alone. In the azure-cli command logic, -n and -g are generally used in conjunction, and they can be replaced by --ids.

brsanche commented 1 year ago

@wu5bocheng hmm.. got it. Then it might be worth to explain that in the helper --h, since that's not self-explanatory.

wu5bocheng commented 1 year ago

@brsanche Thank you for your advice, we will consider adding it into the startup documents.