Azure / Azure/azure-cli-extensions

AMG: KeyError: 'meta'

Open
#8,298 1 comment 0 reactions 2 assignees Claimed by @kairu-ms View on GitHub
Auto-Assign bug customer-reported extension/grafana Service Attention
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

### Describe the bug

When I run `az grafana dashboard import --resource-group "$(tf_grafana_resource_group_name)" --name "$(tf_grafana_instance_name)" --definition $file --overwrite` an error occurs

### Related command

`az grafana dashboard import`

### Errors

```
ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: 'meta'
Traceback (most recent call last):
File "/opt/az/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
raise ex
File "/opt/az/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/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 703, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 336, in __call__
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
^^^^^^^^^^^^^^^^^^
File "/opt/az/azcliextensions/amg/azext_amg/custom.py", line 389, in import_dashboard
if data["meta"]["isFolder"]:
~~~~^^^^^^^^
KeyError: 'meta'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
```

### Issue script & Debug output

I can't provide a debug log right now, as it is run in a pipeline. Will try to reproduce locally and update later.

### Expected behavior

The dashboard should be imported, as it is a vlid file and not a folder.

### Environment Summary

azure-cli 2.66.0 *

core 2.66.0 *
telemetry 1.1.0

Extensions:
azure-devops 1.0.1

Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1

Python location '/opt/az/bin/python3'
Extensions directory '/opt/az/azcliextensions'

Python (Linux) 3.12.7 (main, Oct 30 2024, 03:56:40) [GCC 11.4.0]

### Additional context

I had a look into the files and the line in question was added in #8207. I will try to use the version 2.5.0 instead of newest version to verify. I can't easily reproduce that locally as it runs in a pipeline.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.