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 import Grafana dashboard with Azure CLI extension #8299

Open pauldotyu opened 3 days ago

pauldotyu commented 3 days ago

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az grafana dashboard import Extension Name: amg. Version: 2.5.3.

Errors:

The command failed with an unexpected error. Here is the traceback:
'meta'
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 733, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 703, in _run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 336, in __call__
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
           ^^^^^^^^^^^^^^^^^^
  File "/Users/paul/.azure/cliextensions/amg/azext_amg/custom.py", line 389, in import_dashboard
    if data["meta"]["isFolder"]:
       ~~~~^^^^^^^^
KeyError: 'meta'

To Reproduce:

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

Expected Behavior

Dashboard should import without error.

Environment Summary

macOS-15.1-arm64-arm-64bit, Darwin 24.1.0
Python 3.12.7
Installer: HOMEBREW

azure-cli 2.67.0

Extensions:
aks-preview 13.0.0b2
amg 2.5.3
azure-firewall 1.2.2
fleet 1.4.0
k8s-extension 1.6.2

Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1

Additional Context

yonzhan commented 3 days ago

route to service team