question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Query of output from VMSS List not working

See original GitHub issue

Describe 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

  1. Create a VMSS in a resource group
  2. Set the Resource group name to $CLUSTER_RESOURCE_GROUP
  3. Run az vmss list --resource-group $CLUSTER_RESOURCE_GROUP -o table
  4. 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

Screen Shot 2020-08-07 at 12 31 46 PM

Additionally I tried a few different ways to query the results, none showed the results as seen in the screenshot below. Screen Shot 2020-08-07 at 12 41 33 PM

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
qwordycommented, Aug 11, 2020

Glad to know that your problem is resolved.

0reactions
jgardner04commented, Aug 10, 2020

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'

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found