You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/data-types.md
+19-7Lines changed: 19 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -355,14 +355,11 @@ var storageName = 'storage${uniqueString(resourceGroup().id)}'
355
355
356
356
### Multi-line strings
357
357
358
-
In Bicep, multi-line strings are defined between three single quotation marks (`'''`) followed optionally by a newline (the opening sequence) and three single quotation marks (`'''` is the closing sequence). Characters that are entered between the opening and closing sequence are read verbatim. Escaping isn't necessary or possible.
358
+
## Multi-line strings
359
359
360
-
> [!NOTE]
361
-
> The Bicep parser reads every character as it is. Depending on the line endings of your Bicep file, newlines are interpreted as either `\r\n` or `\n`.
362
-
>
363
-
> Interpolation isn't currently supported in multi-line strings. Because of this limitation, you might need to use the [`concat`](./bicep-functions-string.md#concat) function instead of using [interpolation](#strings).
364
-
>
365
-
> Multi-line strings that contain `'''` aren't supported.
360
+
You can define a multi-line string by enclosing it in three single quotation marks (`'''`). The string content is preserved exactly as written, so escape characters are not required. The delimiter `'''` cannot appear within the string.
361
+
362
+
The string may begin immediately after the opening delimiter or on the following line. In both cases, the resulting value does not include a leading newline. Line breaks are interpreted as `\r\n` or `\n`, depending on the line-ending format of the Bicep file.
366
363
367
364
```bicep
368
365
// evaluates to "hello!"
@@ -396,6 +393,21 @@ var myVar6 = '''interpolation
396
393
is ${blocked}'''
397
394
```
398
395
396
+
With Bicep CLI version 0.X.X or higher, string interpolation is supported. An optional `$` prefix can be added before the opening delimiter to enable string interpolation using standard Bicep `${...}` syntax. If you need to include ${...} as a literal value without escaping, you can control interpolation by repeating the `$` prefix. Interpolation is only performed when the number of `$` characters preceding `${...}` matches the number of `$` characters used in the opening delimiter.
397
+
398
+
```bicep
399
+
// evaluates to "this is a test"
400
+
var interpolated = 'a test'
401
+
var myVar7 = $'''
402
+
this is ${interpolated}'''
403
+
404
+
// evaluates to "this is a testthis is not ${interpolated}"
405
+
var interpolated = 'a test'
406
+
var myVar8 = $$'''
407
+
this is $${interpolated}
408
+
this is not ${interpolated}'''
409
+
```
410
+
399
411
### String-related operators
400
412
401
413
- See [Comparison operators](./operators-comparison.md).
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/file.md
+1-27Lines changed: 1 addition & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Bicep file structure and syntax
3
3
description: Understand how to use declarative syntax to understand the structure and properties of Bicep files.
4
4
ms.topic: article
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 07/25/2025
6
+
ms.date: 01/13/2026
7
7
---
8
8
9
9
# Bicep file structure and syntax
@@ -412,32 +412,6 @@ The following example shows a multiline comment.
412
412
param existingKeyVaultName string
413
413
```
414
414
415
-
## Multi-line strings
416
-
417
-
You can break a string into multiple lines. Use three single quotation marks `'''` to start and end the multi-line string.
418
-
419
-
Characters within the multi-line string are handled as is. Escape characters are unnecessary. You can't include `'''` in the multi-line string. String interpolation isn't currently supported.
420
-
421
-
You can start your string right after the opening `'''`, or include a new line. In either case, the resulting string doesn't include a new line. Depending on the line endings in your Bicep file, new lines are interpreted as `\r\n` or `\n`.
422
-
423
-
The following example shows a multi-line string.
424
-
425
-
```bicep
426
-
var stringVar = '''
427
-
this is multi-line
428
-
string with formatting
429
-
preserved.
430
-
'''
431
-
```
432
-
433
-
The preceding example is equivalent to the following JSON:
434
-
435
-
```json
436
-
"variables": {
437
-
"stringVar": "this is multi-line\r\n string with formatting\r\n preserved.\r\n"
438
-
}
439
-
```
440
-
441
415
## Multiple-line declarations
442
416
443
417
You can now use multiple lines in function, array, and object declarations. This feature requires [Bicep CLI version 0.7.X or higher](./install.md).
0 commit comments