Azure / Azure/azure-cli

az search admin-key without subcommend doesn't show subcommands

Open
#31,173 4 comments 0 reactions 0 assignees View on GitHub
act-codegen-extensibility-squad Auto-Resolve bug Possible-Solution Search Service Attention Similar-Issue
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

The command for `az search admin-key` and `az search query-key` shows error for missing subcommand but doesn't say how to get the subcommands list or show an example subcommand.

Image

### Related command

Image

### Errors

the following arguments are required: _subcommand

### Issue script & Debug output

az search admin-key --debug
cli.knack.cli: Command arguments: ['search', 'admin-key', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [, , ]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'search': ['azure.cli.command_modules.search']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: search 0.432 7 19
cli.azure.cli.core: Total (1) 0.432 7 19
cli.azure.cli.core: Loaded 7 groups, 19 commands.
cli.azure.cli.core: Found a match in the command group table for 'search admin-key'.
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate []
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\diberry\.azure\commands\2025-04-01.06-26-44.search_admin-key.27120.log'.
az_command_data_logger: command args: search admin-key --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [.add_subscription_parameter at 0x0000015E32AD6840>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [.add_ids_arguments at 0x0000015E32B38860>, .add_cache_arguments at 0x0000015E32B389A0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
urllib3.connectionpool: Starting new HTTPS connection (1): app.aladdin.microsoft.com:443
urllib3.connectionpool: https://app.aladdin.microsoft.com:443 "GET /api/v1.0/suggestions?query=%7B%22command%22%3A+%22search+admin-key%22%2C+%22parameters%22%3A+%22%22%7D&clientType=AzureCli&context=%7B%22versionNumber%22%3A+%222.61.0%22%2C+%22errorType%22%3A+%22MissingRequiredSubcommand%22%2C+%22correlationId%22%3A+%22bf1b6792-697a-4492-9c37-bd424b7878b9%22%2C+%22subscriptionId%22%3A+%221bd6f57f-967b-4aed-a90f-d13ad8d84ffe%22%2C+%22eventId%22%3A+%22072c4cdf-b0f4-4b62-888b-34e6c0399272%22%7D HTTP/1.1" 200 None
cli.azure.cli.core.azclierror: NoneType: None

cli.azure.cli.core.azclierror: the following arguments are required: _subcommand
az_command_data_logger: the following arguments are required: _subcommand

Examples from AI knowledge base:
https://aka.ms/cli_ref
Read more about the command in reference docs
cli.knack.cli: Event: Cli.PostExecute []
az_command_data_logger: exit code: 2
cli.__main__: Command ran in 2.155 seconds (init: 0.973, invoke: 1.182)
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 3764 in cache
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\diberry\.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

### Expected behavior

tell me what is missing with an example

### Environment Summary

{
"azure-cli": "2.61.0",
"azure-cli-core": "2.61.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {}
}

### Additional context

_No response_

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.