Skip to content

az grafana show requires a resource group while az grafana service-account does not #31799

@senioroman4uk

Description

@senioroman4uk

Describe the bug

az grafana show --name vromanchuk-test-grafana

Related command

I was trying to get a url of a grafana instance in our dashboard deployment script, but it turns out it requires a resource group, while at the same time to create a service account resource group is not required, I was wondering is it possible to call az grafana show without setting resource group

steps to reproduce
az login

az grafana show --name vromanchuk-test-grafana

Errors

InvalidArgumentValue: Missing required field: --resource-group

Issue script & Debug output

az grafana show --name vromanchuk-test-grafana --debug
cli.knack.cli: Command arguments: ['grafana', 'show', '--name', 'vromanchuk-test-grafana', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x000002887310B2E0>, <function OutputProducer.on_global_arguments at 0x00000288734AC180>, <function CLIQuery.on_global_arguments at 0x00000288734D5580>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'grafana': ['azext_amg']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: Total (0) 0.000 0 0
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: amg 1.270 13 53 C:\Users\vromanchuk.azure\cliextensions\amg
cli.azure.cli.core: Total (1) 1.270 13 53
cli.azure.cli.core: Loaded 13 groups, 53 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : grafana show
cli.azure.cli.core: Command table: grafana show
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x00000288756EAE80>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\vromanchuk.azure\commands\2025-07-12.14-31-25.grafana_show.35744.log'.
az_command_data_logger: command args: grafana show --name {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x0000028875713740>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x0000028875751F80>, <function register_cache_arguments..add_cache_arguments at 0x00000288757520C0>, <function register_upcoming_breaking_change_info..update_breaking_change_info at 0x0000028875752160>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x00000288734AC220>, <function CLIQuery.handle_query_parameter at 0x00000288734D5620>, <function register_ids_argument..parse_ids_arguments at 0x0000028875752020>]
az_command_data_logger: extension name: amg
az_command_data_logger: extension version: 2.7.0
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_command_ctx.py", line 53, in format_args
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_arg_fmt.py", line 415, in call
azure.cli.core.aaz.exceptions.AAZInvalidArgValueError: InvalidArgumentValue: Missing required field: --resource-group

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 666, in execute
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 734, in _run_jobs_serially
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 703, in _run_job
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_command.py", line 155, in call
File "C:\Users\vromanchuk.azure\cliextensions\amg\azext_amg\aaz\latest\grafana_show.py", line 29, in _handler
super()._handler(command_args)
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_command.py", line 165, in _handler
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/aaz/_command_ctx.py", line 55, in format_args
azure.cli.core.azclierror.InvalidArgumentValueError: InvalidArgumentValue: Missing required field: --resource-group

cli.azure.cli.core.azclierror: InvalidArgumentValue: Missing required field: --resource-group
az_command_data_logger: InvalidArgumentValue: Missing required field: --resource-group
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x00000288756EB100>]
az_command_data_logger: exit code: 1
cli.main: Command ran in 2.211 seconds (init: 0.668, invoke: 1.543)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3892 in cache file under C:\Users\vromanchuk.azure\telemetry\20250712143126279
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry_init_.pyc C:\Users\vromanchuk.azure C:\Users\vromanchuk.azure\telemetry\20250712143126279"
telemetry.process: Return from creating process 20564
telemetry.main: Finish creating telemetry upload process.

Expected behavior

az grafana show works without the need to provide resource group. Or any other workaround to get grafana instance url without resource group

Environment Summary

azure-cli 2.75.0

core 2.75.0
telemetry 1.1.0

Extensions:
amg 2.7.0
azure-devops 1.0.1

Dependencies:
msal 1.33.0b1
azure-mgmt-resource 23.3.0

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Config directory 'C:\Users\vromanchuk.azure'
Extensions directory 'C:\Users\vromanchuk.azure\cliextensions'

Python (Windows) 3.12.10 (tags/v3.12.10:0cc8128, Apr 8 2025, 12:21:36) [MSC v.1943 64 bit (AMD64)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botService AttentionThis issue is responsible by Azure service team.amgAzure Managed GrafanabugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions