Azure / Azure/azure-cli

Parameter values that have spaces

Open
#25,042 2 comments 1 reaction 1 assignee Claimed by @zhoxing-ms View on GitHub
act-observability-squad Auto-Assign Azure CLI Team Compute customer-reported feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

Its not clear how to handle parameter values that have spaces in.

I am having a hard time trying to deploy a runCommand using bicep - where parameters values don't have spaces it works, however where they do have spaces it seems to throw off my script. So i turned to these docs for guidance, to discover that nothing is mentioned in terms of dealing with spaces - it says parameters should be space seperated but not what to do if a single paramater has spaces itself. I would expect the paramter value would need to be quoted?

```bicep
protectedScriptParameters: [
{ value: '-a' }, { value: 'foo' }
{ value: '-z' }, { value: 'this fails' }
]

```

---
#### Document Details

⚠ *Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.*

* ID: f04b196d-7d11-7213-f037-f12b85b19c52
* Version Independent ID: adc05d8e-b13b-134b-5f61-42aaf23666df
* Content: [az vm run-command](https://learn.microsoft.com/en-us/cli/azure/vm/run-command?view=azure-cli-latest)
* Content Source: [latest/docs-ref-autogen/vm/run-command.yml](https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/latest/docs-ref-autogen/vm/run-command.yml)
* Service: **virtual-machines**
* GitHub Login: @rloutlaw
* Microsoft Alias: **routlaw**

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.