Azure / Azure/azure-cli

az vmss run-command misleading help text and list results

Open
#29,825 3 comments 0 reactions 2 assignees Claimed by @zhoxing-ms View on GitHub
act-observability-squad Auto-Assign Auto-Resolve Azure CLI Team Compute question
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### 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:**
```sh
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`
```sh
$ 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.
```sh
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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.