Open daviewales opened 6 months ago
Thank you for opening this issue, we will look into it.
Please note that the attribute names obtained using -o json
and -o table
are inconsistent.
Please try using az account list --query "[].{Name: name, SubscriptionId: id}" -o table
instead.
(env) PS C:\Users\zhoxing.FAREAST\Desktop\project> az account list --query "[].{Name: name, SubscriptionId: id}" -o table
Name SubscriptionId
------------------------------------------------ ------------------------------------
.....
That works, but it seems a bit strange that the names would be different. The query is a JMESPath query, which is defined in terms of JSON, so it's confusing that you can't use the names from the JSON output.
Describe the bug
I am trying to query the names and IDs of my Azure subscriptions. The following commands do exactly what I want with JSON or TSV output:
However, if I switch to
table
output, I only get the name field:I thought that perhaps the
table
output doesn't support the subscription ID field, so I tried the same as above, but without the--query
. However, this does include the subscription ID:It would be nice to be able to use
-o table
output with--query
, and get the same data that is included in the other output formats.Related command
az account list
Errors
NA
Issue script & Debug output
Expected behavior
I expected the
-o table
output to include the selected fields, the same as-o tsv
.Environment Summary
Additional context
No response