Skip to content

az vmss run-command misleading help text and list results #29825

Description

@benjamin-brady

Describe the bug

When invoking a run-command on a VMSS instance it's not possible to tell what the possible values of command IDs is. The help text tells the user to use the command az vmss run-command list which returns zero results. However it's possible to use --command-id RunShellScript but this is not documented in the help text below or from the listing the command-ids.

Help text:

az vmss run-command invoke --help              

Command
   az vmss run-command invoke : Execute a specific run command on a Virtual Machine Scale Set
   instance.
       `az vmss run-command show` returns helpful information on each run-command. Discover Run
       command-id's via `az vmss run-command list`.
...

Listing command-ids:
The returned command-ids should have values for RunShellScript and RunPowerShellScript

$ az vmss run-command list  -g MC_my_rg --vmss-name aks-nodes-12345678-vmss --instance-id 0
[]

An example of a working command to invoke a run-command:
Note that RunShellScript can be used for the command-id arg.

az vmss run-command invoke --ids /subscriptions/12345678-60fe-4441-be73-aaaaaaaaaaa/resourceGroups/MC_my_rg/providers/Microsoft.Compute/virtualMachineScaleSets/aks-nodes-12345678-vmss/virtualMachines/0 --command-id "RunShellScript" --script "echo 'from az runcommand' > /var/log/command.txt"

Related command

az vmss run-command invoke --help

Errors

No errors - just poor quality help text

Issue script & Debug output

n/a

Expected behavior

The help tells me I can use RunShellScript or RunPowerShellScript as valid command IDs.

Environment Summary

$ az --version
azure-cli                         2.63.0

core                              2.63.0
telemetry                          1.1.0

Extensions:
aks-preview                      8.0.0b1

Dependencies:
msal                              1.30.0
azure-mgmt-resource               23.1.1

Python location '/opt/az/bin/python3'
Extensions directory '/home/xtian/.azure/cliextensions'

Python (Linux) 3.11.8 (main, Jul 31 2024, 03:39:39) [GCC 11.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/snapshotact-observability-squadquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions