Skip to content

functionapp identity show crashes when the funtionapp name does not reference an existing functionapp #18497

@Steven-Burns

Description

@Steven-Burns

This is autogenerated. Please review and update as needed.

Describe the bug

functionapp identity show crashes when the funtionapp name does not reference an existing functionapp.

Command Name
az functionapp identity show

Errors:

The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'identity'
Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 657, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 691, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 363, in handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/arm.py", line 417, in show_exception_handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 361, in handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 798, in show_identity
AttributeError: 'NoneType' object has no attribute 'identity'

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 functionapp identity show -g my-resource-group -n PUT-AN-APP-NAME-THAT-DOES-NOT-EXIST-HERE

Expected Behavior

Better exception handling indicating that the named functionapp does not exist, instead of a crash stacktrace.

Environment Summary

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

azure-cli 2.24.2 *

Extensions:
azure-devops 0.18.0
azure-iot 0.10.13

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Functionsaz functionappService AttentionThis issue is responsible by Azure service team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions