Skip to content

Commit d5841fb

Browse files
authored
Merge pull request #99124 from akhilthomas011/akhilthomas-patch2
Added comments on file functions path
2 parents 7840d3e + 2074093 commit d5841fb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

articles/azure-resource-manager/bicep/bicep-functions-files.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Bicep functions - files
33
description: Describes the functions to use in a Bicep file to load content from a file.
44
ms.topic: conceptual
5-
ms.date: 07/08/2022
5+
ms.date: 09/28/2022
66
---
77

88
# File functions for Bicep
@@ -21,11 +21,11 @@ Namespace: [sys](bicep-functions.md#namespaces-for-functions).
2121

2222
| Parameter | Required | Type | Description |
2323
|:--- |:--- |:--- |:--- |
24-
| filePath | Yes | string | The path to the file to load. The path is relative to the deployed Bicep file. |
24+
| filePath | Yes | string | The path to the file to load. The path is relative to the deployed Bicep file, and it should be a compile-time constant (cannot use variables). |
2525

2626
### Remarks
2727

28-
Use this function when you have binary content you would like to include in deployment. Rather than manually encoding the file to a base64 string and adding it to your Bicep file, load the file with this function. The file is loaded when the Bicep file is compiled to a JSON template. During deployment, the JSON template contains the contents of the file as a hard-coded string.
28+
Use this function when you have binary content you would like to include in deployment. Rather than manually encoding the file to a base64 string and adding it to your Bicep file, load the file with this function. The file is loaded when the Bicep file is compiled to a JSON template. Hence variables cannot be used in filePath as they are not resolved at this stage. During deployment, the JSON template contains the contents of the file as a hard-coded string.
2929

3030
This function requires **Bicep version 0.4.412 or later**.
3131

@@ -47,13 +47,13 @@ Namespace: [sys](bicep-functions.md#namespaces-for-functions).
4747

4848
| Parameter | Required | Type | Description |
4949
|:--- |:--- |:--- |:--- |
50-
| filePath | Yes | string | The path to the file to load. The path is relative to the deployed Bicep file. |
50+
| filePath | Yes | string | The path to the file to load. The path is relative to the deployed Bicep file. The path is relative to the deployed Bicep file, and it should be a compile-time constant (cannot use variables). |
5151
| jsonPath | No | string | JSONPath expression to take only a part of the JSON into ARM. |
5252
| encoding | No | string | The file encoding. The default value is `utf-8`. The available options are: `iso-8859-1`, `us-ascii`, `utf-16`, `utf-16BE`, or `utf-8`. |
5353

5454
### Remarks
5555

56-
Use this function when you have JSON content or minified JSON content that is stored in a separate file. Rather than duplicating the JSON content in your Bicep file, load the content with this function. You can load a part of a JSON file by specifying a JSON path. The file is loaded when the Bicep file is compiled to the JSON template. During deployment, the JSON template contains the contents of the file as a hard-coded string.
56+
Use this function when you have JSON content or minified JSON content that is stored in a separate file. Rather than duplicating the JSON content in your Bicep file, load the content with this function. You can load a part of a JSON file by specifying a JSON path. The file is loaded when the Bicep file is compiled to the JSON template. Hence variables cannot be used in filePath as they are not resolved at this stage. During deployment, the JSON template contains the contents of the file as a hard-coded string.
5757

5858
In VS Code, the properties of the loaded object are available intellisense. For example, you can create a file with values to share across many Bicep files. An example is shown in this article.
5959

@@ -89,12 +89,12 @@ Namespace: [sys](bicep-functions.md#namespaces-for-functions).
8989

9090
| Parameter | Required | Type | Description |
9191
|:--- |:--- |:--- |:--- |
92-
| filePath | Yes | string | The path to the file to load. The path is relative to the deployed Bicep file. |
92+
| filePath | Yes | string | The path to the file to load. The path is relative to the deployed Bicep file. The path is relative to the deployed Bicep file, and it should be a compile-time constant (cannot use variables). |
9393
| encoding | No | string | The file encoding. The default value is `utf-8`. The available options are: `iso-8859-1`, `us-ascii`, `utf-16`, `utf-16BE`, or `utf-8`. |
9494

9595
### Remarks
9696

97-
Use this function when you have content that is more stored in a separate file. Rather than duplicating the content in your Bicep file, load the content with this function. For example, you can load a deployment script from a file. The file is loaded when the Bicep file is compiled to the JSON template. During deployment, the JSON template contains the contents of the file as a hard-coded string.
97+
Use this function when you have content that is more stored in a separate file. Rather than duplicating the content in your Bicep file, load the content with this function. For example, you can load a deployment script from a file. The file is loaded when the Bicep file is compiled to the JSON template. Hence variables cannot be used in filePath as they are not resolved at this stage. During deployment, the JSON template contains the contents of the file as a hard-coded string.
9898

9999
Use the [`loadJsonContent()`](#loadjsoncontent) function to load JSON files.
100100

0 commit comments

Comments
 (0)