Skip to content

Commit b7a3bf7

Browse files
Merge pull request #228228 from mumian/0222-escape-single-quotes
escape single quotes
2 parents 1eb5dac + 1657004 commit b7a3bf7

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

articles/azure-resource-manager/templates/template-expressions.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Template syntax and expressions
33
description: Describes the declarative JSON syntax for Azure Resource Manager templates (ARM templates).
44
ms.topic: conceptual
5-
ms.date: 02/09/2023
5+
ms.date: 02/22/2023
66
ms.custom: devx-track-azurepowershell
77
---
88

@@ -67,6 +67,23 @@ To escape double quotes in an expression, such as adding a JSON object in the te
6767
},
6868
```
6969

70+
To escape single quotes in an ARM expression output, double up the single quotes. The output of the following template will result in JSON value `{"abc":"'quoted'"}`.
71+
72+
```json
73+
{
74+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
75+
"contentVersion": "1.0.0.0",
76+
"parameters": {},
77+
"resources": [],
78+
"outputs": {
79+
"foo": {
80+
"type": "object",
81+
"value": "[createObject('abc', '''quoted''')]"
82+
}
83+
}
84+
}
85+
```
86+
7087
When passing in parameter values, the use of escape characters depends on where the parameter value is specified. If you set a default value in the template, you need the extra left bracket.
7188

7289
```json

0 commit comments

Comments
 (0)