Azure / azure-cli

Azure Command-Line Interface
MIT License
4.02k stars 2.99k forks source link

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

Open benjamin-brady opened 2 months ago

benjamin-brady commented 2 months ago

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

azure-client-tools-bot-prd[bot] commented 2 months ago

Hi @benjamin-brady,

2.61.0 is not the latest Azure CLI(2.63.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

yonzhan commented 2 months ago

Thank you for opening this issue, we will look into it.

benjamin-brady commented 2 months ago

I have upgraded to the latest CLI (2.63.0) and the issue is still there.