Describe the bug
az vm show --help includes this:
Resource Id Arguments
--ids : One or more resource IDs (space-delimited). It should be a complete
resource ID containing all information of 'Resource Id' arguments. You
should provide either --ids or other 'Resource Id' arguments.
Note that it says space-delimited. However using spaces between resource IDs is not enough, newlines have to be used.
Example:
$ az vm show --ids '/subscriptions/<SUBID>/resourceGroups/<RGID>/providers/Microsoft.Compute/virtualMachines/<VM NAME1> /subscriptions/<SUBID>/resourceGroups/<RGID>/providers/Microsoft.Compute/virtualMachines/<VM NAME2>'
<JSON of VM NAME1>
missing VM NAME2
$ az vm show --ids "(echo -e /subscriptions/<SUBID>/resourceGroups/<RGID>/providers/Microsoft.Compute/virtualMachines/<VM NAME1>\\n/subscriptions/<SUBID>/resourceGroups/<RGID>/providers/Microsoft.Compute/virtualMachines/<VM NAME2>)"
<array for 2 VMs>
Some other commands completely fail with confusing error messages when --ids are not newline delimited. Basically using tsv output ID from various list commands works here.
Related command
az vm show, az vm start etc
Errors
When used with az vm start --ids:
(ResourceNotFound) The Resource 'Microsoft.Compute/virtualMachines/ ' under resource group '' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound
Message: The Resource 'Microsoft.Compute/virtualMachines/ ' under resource group '' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Issue script & Debug output
This is I think the important part where for example vm start fails:
urllib3.connectionpool: https://management.azure.com:443 "POST /subscriptions/<SUBID>/resourceGroups/<RGID>/providers/Microsoft.Compute/virtualMachines/<VM_NAME1>%20/start?api-version=2022-11-01 HTTP/1.1" 404 235
It encodes the space and uses it as part of resource name it's requesting
Expected behavior
Either of the following would be acceptable:
- Update documentation to make it clear that newlines are required as separators
- Actually accept spaces between resource IDs
Environment Summary
$ az --version
azure-cli 2.60.0 *
core 2.60.0 *
telemetry 1.1.0
Dependencies:
msal 1.28.0
azure-mgmt-resource 23.1.0b2
Additional context
No response
Describe the bug
az vm show --helpincludes this:Note that it says space-delimited. However using spaces between resource IDs is not enough, newlines have to be used.
Example:
Some other commands completely fail with confusing error messages when
--idsare not newline delimited. Basically usingtsvoutput ID from various list commands works here.Related command
az vm show, az vm start etc
Errors
When used with
az vm start --ids:(ResourceNotFound) The Resource 'Microsoft.Compute/virtualMachines/ ' under resource group '' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound
Message: The Resource 'Microsoft.Compute/virtualMachines/ ' under resource group '' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Issue script & Debug output
This is I think the important part where for example vm start fails:
It encodes the space and uses it as part of resource name it's requesting
Expected behavior
Either of the following would be acceptable:
Environment Summary
Additional context
No response