Azure / Azure/azure-cli

table_transformer not working when --query set

Open
#20,789 2 comments 0 reactions 1 assignee Claimed by @jiasli View on GitHub
act-platform-engineering-squad Core feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62

**Describe the bug**
`-o table` output is different when adding `--query`, even the query is filter something instead of trunc some columns.

**To Reproduce**
This two commands want to list azure subscriptions under the account. The first one run w/o query, the second filter out the subscriptions in `AzureCloud` cloud. But the table format are different. One have tenant id while the other not.

This also happens on service command who specify the `table_transformer` for the command.

```
az account list -o table
Name CloudName SubscriptionId State IsDefault
------------------------------------------------- ----------- ------------------------------------ ------- -----------
```

```
az account list -o table --query [?cloudName=='AzureCloud']
Name State IsDefault TenantId HomeTenantId CloudName
------------------------------------------------- ------- ----------- ------------------------------------ ------------------------------------ -----------
```

**Expected behavior**
`table_transformer` is executed

**Environment summary**

Windows 10

```
{
"azure-cli": "2.31.0",
"azure-cli-core": "2.31.0",
"azure-cli-telemetry": "1.0.6",
"extensions": {
}
}
```

**Additional context**

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.