Skip to content

az vm get-instance-view not returning list when providing one ID #28205

@VirtualEvan

Description

@VirtualEvan

Describe the bug

According this documentation, commands which COULD return more than one object should return an array.

az vm get-instance-view --ids "$MY_IDS"

  • Returns an array with objects when $MY_IDS contains more than one value.
  • Returns an object when $MY_IDS contains a single value

This makes queries unreliable. For example: az vm get-instance-view --ids "$MY_IDS" --query "[].id"

Related command

az vm get-instance-view

Errors

No errors

Issue script & Debug output

After having a look at them I don't think they are relevant. Please let me know if actually required and I will spare some time to remove all the sensitive information and provide the logs.

Expected behavior

az vm get-instance-view --ids "my-vm-id" returns an array with a single object

Environment Summary

azure-cli                         2.56.0

core                              2.56.0
telemetry                          1.1.0

Extensions:
azure-devops                      0.26.0
bastion                            0.3.0

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

Python location '/opt/az/bin/python3'
Extensions directory '/home/<my_user>/.azure/cliextensions'

Python (Linux) 3.11.5 (main, Jan  8 2024, 09:08:51) [GCC 9.4.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Labels

Auto-AssignAuto assign by botAuto-ResolveAuto resolve by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamComputeaz vm/vmss/image/disk/snapshotSimilar-Issueact-observability-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions