Azure / Azure/arm-ttk

String containing square brackets is not treated as string

Open
#598 3 comments 0 reactions 1 assignee Claimed by @StartAutomating View on GitHub
bug
Dominant language
PowerShell
Stars
468
Forks
208
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have tried to assign jsons' array as a string to ARM parameter:

schema
```json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"A": {
"type": "string"
}
},
"resources": [
]
}
```
parameters file
```json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"A": {
"value": "[{\"someProperty\":\"someValue\"}]"
}
}
}
```
As long as string value contains square brackets this parameter is not treated as string and results in following error:

`[-] DeploymentParameters Should Have Value (3 ms)
A parameter cannot be found that matches parameter name 'TargetObject'.`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.