Skip to content

Commit 9ff154a

Browse files
authored
Merge pull request #108437 from mumian/0320-ds-codefence
update the codefences
2 parents 32547d9 + 298cbb9 commit 9ff154a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

articles/azure-resource-manager/templates/deployment-script-template.md

Lines changed: 7 additions & 7 deletions
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: 03/16/2020
8+
ms.date: 03/19/2020
99
ms.author: jgao
1010

1111
---
@@ -142,16 +142,16 @@ Property value details:
142142
143143
## Use inline scripts
144144

145-
The following template has one resource defined with the `Microsoft.Resources/deploymentScripts` type.
145+
The following template has one resource defined with the `Microsoft.Resources/deploymentScripts` type. The highlighted part is the inline script.
146146

147-
[!code-json[](~/resourcemanager-templates/deployment-script/deploymentscript-helloworld.json?range=1-54)]
147+
:::code language="json" source="~/resourcemanager-templates/deployment-script/deploymentscript-helloworld.json" range="1-54" highlight="34-40":::
148148

149149
> [!NOTE]
150150
> Because the inline deployment scripts are enclosed in double quotes, the strings inside the deployment scripts need to be enclosed in single quotes instead. The escape character for PowerShell is **\**. You can also consider using string substitution as it is shown in the previous JSON sample. See the default value of the name parameter.
151151
152152
The script takes one parameter, and output the parameter value. **DeploymentScriptOutputs** is used for storing outputs. In the outputs section, the **value** line shows how to access the stored values. `Write-Output` is used for debugging purpose. To learn how to access the output file, see [Debug deployment scripts](#debug-deployment-scripts). For the property descriptions, see [Sample templates](#sample-templates).
153153

154-
To run the script, select **Try it** to open Azure Cloud Shell, and then paste the following code into the shell pane.
154+
To run the script, select **Try it** to open the Cloud Shell, and then paste the following code into the shell pane.
155155

156156
```azurepowershell-interactive
157157
$resourceGroupName = Read-Host -Prompt "Enter the name of the resource group to be created"
@@ -205,7 +205,7 @@ The supporting files are copied to azscripts/azscriptinput at the runtime. Use r
205205

206206
The following template shows how to pass values between two deploymentScripts resources:
207207

208-
[!code-json[](~/resourcemanager-templates/deployment-script/deploymentscript-basic.json?range=1-84)]
208+
:::code language="json" source="~/resourcemanager-templates/deployment-script/deploymentscript-basic.json" range="1-84" highlight="39-40,66":::
209209

210210
In the first resource, you define a variable called **$DeploymentScriptOutputs**, and use it to store the output values. To access the output value from another resource within the template, use:
211211

@@ -219,7 +219,7 @@ Different from the PowerShell deployment script, CLI/bash support does not expos
219219

220220
Deployment script outputs must be saved in the AZ_SCRIPTS_OUTPUT_PATH location, and the outputs must be a valid JSON string object. The contents of the file must be saved as a key-value pair. For example, an array of strings is stored as { "MyResult": [ "foo", "bar"] }. Storing just the array results, for example [ "foo", "bar" ], is invalid.
221221

222-
[!code-json[](~/resourcemanager-templates/deployment-script/deploymentscript-basic-cli.json?range=1-44)]
222+
:::code language="json" source="~/resourcemanager-templates/deployment-script/deploymentscript-basic-cli.json" range="1-44" highlight="32":::
223223

224224
[jq](https://stedolan.github.io/jq/) is used in the previous sample. It comes with the container images. See [Configure development environment](#configure-development-environment).
225225

@@ -263,7 +263,7 @@ armclient get /subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourcegroups
263263

264264
The output is similar to:
265265

266-
[!code-json[](~/resourcemanager-templates/deployment-script/deploymentscript-status.json?range=1-48)]
266+
:::code language="json" source="~/resourcemanager-templates/deployment-script/deploymentscript-status.json" range="1-37" highlight="15,34":::
267267

268268
The output shows the deployment state, and the deployment script resource IDs.
269269

0 commit comments

Comments
 (0)