Skip to content

Commit 74689eb

Browse files
committed
add loadTextContent
1 parent 9232c35 commit 74689eb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

articles/azure-resource-manager/bicep/deployment-script-bicep.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: azure-resource-manager
55
author: mumian
66
ms.service: azure-resource-manager
77
ms.topic: conceptual
8-
ms.date: 11/29/2021
8+
ms.date: 12/28/2021
99
ms.author: jgao
1010

1111
---
@@ -200,6 +200,14 @@ The output looks like:
200200

201201
![ARM Bicep deployment script output](./media/deployment-script-bicep/resource-manager-template-deployment-script-inline-script-output.png)
202202

203+
## Load script file
204+
205+
You can use the [loadTextContent](bicep-functions-files.md#loadtextcontent) function to load a script file as a string. This function enables you to keep the script in a separate file and retrieve it as a deployment script. The path you provide to the script file is relative to the Bicep file.
206+
207+
The following example loads a script from a file and uses it for a deployment script.
208+
209+
::: code language="bicep" source="~/azure-docs-bicep-samples/syntax-samples/functions/loadTextContent/loaddeploymentscript.bicep" highlight="13" :::
210+
203211
## Use external scripts
204212

205213
In addition to inline scripts, you can also use external script files. Only primary PowerShell scripts with the _ps1_ file extension are supported. For CLI scripts, the primary scripts can have any extensions (or without an extension), as long as the scripts are valid bash scripts. To use external script files, replace `scriptContent` with `primaryScriptUri`. For example:

0 commit comments

Comments
 (0)