Azure / azure-cli

Azure Command-Line Interface
MIT License
3.99k stars 2.96k forks source link

'rg' is not a valid value for '--output' #28198

Open ryanmichaeljames opened 8 months ago

ryanmichaeljames commented 8 months ago

Describe the bug

I'm trying to interact with Azure DevOps using the azure-devops extension but every command returns the same error.

'rg' is not a valid value for '--output'. Allowed values: json, jsonc, yaml, yamlc, table, tsv, none.

Related command

az repos show -org https://dev.azure.com/[redacted]/ -r [redacted] --output json

Errors

ERROR: az repos show: 'rg' is not a valid value for '--output'. Allowed values: json, jsonc, yaml, yamlc, table, tsv, none.

Issue script & Debug output

cli.knack.cli: Command arguments: ['repos', 'show', '-org', 'https://dev.azure.com/[redacted]/', '-r', '[redacted]', '--output', 'json', '--debug'] cli.knack.cli: init debug log: Enable color in terminal. Enable VT mode. cli.knack.cli: Event: Cli.PreExecute [] cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x0198E7A8>, <function OutputProducer.on_global_arguments at 0x01CB7898>, <function CLIQuery.on_global_arguments at 0x01CD9668>] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: Modules found from index for 'repos': ['azext_devops'] 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: azure-devops 0.159 60 192 C:\Users[redacted].azure\cliextensions\azure-devops cli.azure.cli.core: Total (1) 0.159 60 192 cli.azure.cli.core: Loaded 60 groups, 192 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : repos show cli.azure.cli.core: Command table: repos show cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x03D9D078>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users[redacted].azure\commands\2024-01-16.10-51-52.repos_show.24704.log'. az_command_data_logger: command args: repos show -o{} {} -r {} --output {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x03DAAC58>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x03DDD348>, <function register_cache_arguments..add_cache_arguments at 0x03DDD398>] 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+%22repos+show%22%2C+%22parameters%22%3A+%22--output%2C--repository%22%7D&clientType=AzureCli&context=%7B%22versionNumber%22%3A+%222.56.0%22%2C+%22errorType%22%3A+%22InvalidOutputType%22%2C+%22correlationId%22%3A+%222b954980-fe1f-417e-8d0f-50a0526c521b%22%2C+%22subscriptionId%22%3A+%229e6d9ba4-38b6-4fa4-a1e6-3c4c7dcd68d8%22%2C+%22eventId%22%3A+%22105a377f-6f3a-4a30-93f6-5ec0a6f226d6%22%7D HTTP/1.1" 200 None cli.azure.cli.core.azclierror: NoneType: None

cli.azure.cli.core.azclierror: az repos show: 'rg' is not a valid value for '--output'. Allowed values: json, jsonc, yaml, yamlc, table, tsv, none. az_command_data_logger: az repos show: 'rg' is not a valid value for '--output'. Allowed values: json, jsonc, yaml, yamlc, table, tsv, none.

Examples from AI knowledge base: https://aka.ms/cli_ref Read more about the command in reference docs cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x03D9D1B8>] az_command_data_logger: exit code: 2 cli.main: Command ran in 2.220 seconds (init: 0.554, invoke: 1.666) 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 3557 in cache telemetry.main: Begin creating telemetry upload process. telemetry.process: Creating upload process: "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry__init__.pyc C:\Users[redacted].azure" telemetry.process: Return from creating process telemetry.main: Finish creating telemetry upload process.

Expected behavior

The command returns the repo details.

Environment Summary

azure-cli 2.56.0

core 2.56.0 telemetry 1.1.0

Extensions: azure-devops 0.26.0

Dependencies: msal 1.24.0b2 azure-mgmt-resource 23.1.0b2

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe' Extensions directory 'C:\Users[redacted].azure\cliextensions'

Python (Windows) 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:21:31) [MSC v.1936 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

The error occurs both with and without the --output parameter.

yonzhan commented 8 months ago

Thank you for opening this issue, we will look into it.

microsoft-github-policy-service[bot] commented 8 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @v-anvashist, @V-hmusukula.

risksoft-atacana commented 6 months ago

Hello Team,

I receive the same error when trying to add an AAD group to a DevOps group even if i setup the output to json or none

Is there a fix for this issue?

Robson-Rocha commented 4 months ago

I had a very similar issue when running azure pipelines run, and it turned out that the error was that I was using single dashes instead of double dashes when calling the parameters. Changing everything to double-dashes solved the issue.