Query of output from VMSS List not working
See original GitHub issueDescribe the bug
When running a query on the output from the az vmss list
command, no resources are found even when there are results.
To Reproduce
- Create a VMSS in a resource group
- Set the Resource group name to $CLUSTER_RESOURCE_GROUP
- Run
az vmss list --resource-group $CLUSTER_RESOURCE_GROUP -o table
- Query the results for a name with this command:
az vmss list --resource-group $CLUSTER_RESOURCE_GROUP --query Name -o table
Expected behavior
The output of the command in step 4 should produce a single column with the VMSS name.
Environment summary
OS: macOS Catalina 10.15.6 CLI Install method: homebrew CLI Version output
azure-cli 2.10.1
command-modules-nspkg 2.0.3
core 2.10.1
nspkg 3.0.4
telemetry 1.0.4
Extensions:
azure-firewall 0.2.0
aks-preview 0.4.43
azure-devops 0.11.0
Python location '/usr/local/Cellar/azure-cli/2.10.1/libexec/bin/python'
Extensions directory '/Users/jogardn/.azure/cliextensions'
Python (Darwin) 3.8.5 (default, Jul 21 2020, 10:48:26)
[Clang 11.0.3 (clang-1103.0.32.62)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
Additionally I tried a few different ways to query the results, none showed the results as seen in the screenshot below.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
az vmss list command returns empty value - Microsoft Q&A
I have two resource groups in Azure, each contains one VMSS (Virtual Machine Scale Sets) and the resources are visible in Azure Portal....
Read more >Azure PS command returns empty list - Stack Overflow
When running the "az vmss list" command within the Cloud Shell, we are able to get the respective resource. CloudShell CLI Command output....
Read more >Check for Empty Virtual Machine Scale Sets | Trend Micro
Check for Empty Virtual Machine Scale Sets · 01 Run account list command (Windows/macOS/Linux) using custom query filters to list the IDs of...
Read more >azure-cli-vm 2.0.8 - PyPI
Improve table output for vm/vmss commands: get-instance-view, list, show, ... vmss: hide arg 'vmss show --ids', which is not supposed to work because...
Read more >Command-line interface | Citrix Hypervisor 8.2
Tab completion does not normally work when executing commands on a remote Citrix ... In the output from parameter list commands, such as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Glad to know that your problem is resolved.
Closing for user error.
Correct query is:
az vmss list --resource-group $CLUSTER_RESOURCE_GROUP --query '[].name' -o tsv
My issue was that I used
'[].Name'
instead of'[].name'