Skip to content

Commit ff5439a

Browse files
committed
update azPowerShellVersion and azCliVersion
1 parent 55bd0bc commit ff5439a

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

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

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ services: azure-resource-manager
55
author: mumian
66
ms.service: azure-resource-manager
77
ms.topic: conceptual
8-
ms.date: 10/26/2022
8+
ms.date: 11/01/2022
99
ms.author: jgao
10-
1110
---
1211

1312
# Use deployment scripts in Bicep
@@ -101,7 +100,7 @@ resource runPowerShellInline 'Microsoft.Resources/deploymentScripts@2020-10-01'
101100
storageAccountName: 'myStorageAccount'
102101
storageAccountKey: 'myKey'
103102
}
104-
azPowerShellVersion: '6.4' // or azCliVersion: '2.28.0'
103+
azPowerShellVersion: '8.3' // or azCliVersion: '2.40.0'
105104
arguments: '-name \\"John Dole\\"'
106105
environmentVariables: [
107106
{
@@ -180,7 +179,7 @@ Property value details:
180179

181180
The following Bicep file has one resource defined with the `Microsoft.Resources/deploymentScripts` type. The highlighted part is the inline script.
182181

183-
:::code language="bicep" source="~/azure-docs-bicep-samples/samples/deployment-script/inlineScript.bicep" range="1-25" highlight="11-17":::
182+
:::code language="bicep" source="~/azure-docs-bicep-samples/samples/deployment-script/inlineScript.bicep" range="1-26" highlight="12-18":::
184183

185184
The script takes a parameter, and output the parameter value. `DeploymentScriptOutputs` is used for storing outputs. The output line shows how to access the stored values. `Write-Output` is used for debugging purpose. To learn how to access the output file, see [Monitor and troubleshoot deployment scripts](#monitor-and-troubleshoot-deployment-scripts). For the property descriptions, see [Sample Bicep files](#sample-bicep-files).
186185

@@ -207,7 +206,7 @@ You can use the [loadTextContent](bicep-functions-files.md#loadtextcontent) func
207206

208207
The following example loads a script from a file and uses it for a deployment script.
209208

210-
::: code language="bicep" source="~/azure-docs-bicep-samples/syntax-samples/functions/loadTextContent/loaddeploymentscript.bicep" highlight="13" :::
209+
:::code language="bicep" source="~/azure-docs-bicep-samples/syntax-samples/functions/loadTextContent/loaddeploymentscript.bicep" highlight="13" :::
211210

212211
## Use external scripts
213212

@@ -247,7 +246,7 @@ The supporting files are copied to `azscripts/azscriptinput` at the runtime. Use
247246

248247
The following Bicep file shows how to pass values between two `deploymentScripts` resources:
249248

250-
:::code language="bicep" source="~/azure-docs-bicep-samples/samples/deployment-script/passValues.bicep" range="1-45" highlight="17-18,33":::
249+
:::code language="bicep" source="~/azure-docs-bicep-samples/samples/deployment-script/passValues.bicep" range="1-46" highlight="18-19,34":::
251250

252251
In the first resource, you define a variable called `$DeploymentScriptOutputs`, and use it to store the output values. Use resource symbolic name to access the output values.
253252

@@ -257,7 +256,7 @@ Different from the PowerShell deployment script, CLI/bash support doesn't expose
257256

258257
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.
259258

260-
:::code language="bicep" source="~/azure-docs-bicep-samples/samples/deployment-script/passValue-cli.bicep" range="1-35" highlight="29":::
259+
:::code language="bicep" source="~/azure-docs-bicep-samples/samples/deployment-script/passValue-cli.bicep" range="1-36" highlight="30":::
261260

262261
[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).
263262

@@ -380,10 +379,10 @@ SubscriptionId : 01234567-89AB-CDEF-0123-456789ABCDEF
380379
ProvisioningState : Succeeded
381380
Identity : /subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/mydentity1008rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myuami
382381
ScriptKind : AzurePowerShell
383-
AzPowerShellVersion : 3.0
384-
StartTime : 6/18/2020 7:46:45 PM
385-
EndTime : 6/18/2020 7:49:45 PM
386-
ExpirationDate : 6/19/2020 7:49:45 PM
382+
AzPowerShellVersion : 8.3
383+
StartTime : 6/18/2022 7:46:45 PM
384+
EndTime : 6/18/2022 7:49:45 PM
385+
ExpirationDate : 6/19/2022 7:49:45 PM
387386
CleanupPreference : OnSuccess
388387
StorageAccountId : /subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0618rg/providers/Microsoft.Storage/storageAccounts/ftnlvo6rlrvo2azscripts
389388
ContainerInstanceId : /subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0618rg/providers/Microsoft.ContainerInstance/containerGroups/ftnlvo6rlrvo2azscripts
@@ -411,13 +410,13 @@ The list command output is similar to:
411410
[
412411
{
413412
"arguments": "-name \\\"John Dole\\\"",
414-
"azPowerShellVersion": "3.0",
413+
"azPowerShellVersion": "8.3",
415414
"cleanupPreference": "OnSuccess",
416415
"containerSettings": {
417416
"containerGroupName": null
418417
},
419418
"environmentVariables": null,
420-
"forceUpdateTag": "20200625T025902Z",
419+
"forceUpdateTag": "20220625T025902Z",
421420
"id": "/subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0624rg/providers/Microsoft.Resources/deploymentScripts/runPowerShellInlineWithOutput",
422421
"identity": {
423422
"tenantId": "01234567-89AB-CDEF-0123-456789ABCDEF",
@@ -442,19 +441,19 @@ The list command output is similar to:
442441
"scriptContent": "\r\n param([string] $name)\r\n $output = \"Hello {0}\" -f $name\r\n Write-Output $output\r\n $DeploymentScriptOutputs = @{}\r\n $DeploymentScriptOutputs['text'] = $output\r\n ",
443442
"status": {
444443
"containerInstanceId": "/subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0624rg/providers/Microsoft.ContainerInstance/containerGroups/64lxews2qfa5uazscripts",
445-
"endTime": "2020-06-25T03:00:16.796923+00:00",
444+
"endTime": "2022-06-25T03:00:16.796923+00:00",
446445
"error": null,
447-
"expirationTime": "2020-06-26T03:00:16.796923+00:00",
448-
"startTime": "2020-06-25T02:59:07.595140+00:00",
446+
"expirationTime": "2022-06-26T03:00:16.796923+00:00",
447+
"startTime": "2022-06-25T02:59:07.595140+00:00",
449448
"storageAccountId": "/subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0624rg/providers/Microsoft.Storage/storageAccounts/64lxews2qfa5uazscripts"
450449
},
451450
"storageAccountSettings": null,
452451
"supportingScriptUris": null,
453452
"systemData": {
454-
"createdAt": "2020-06-25T02:59:04.750195+00:00",
453+
"createdAt": "2022-06-25T02:59:04.750195+00:00",
455454
"createdBy": "[email protected]",
456455
"createdByType": "User",
457-
"lastModifiedAt": "2020-06-25T02:59:04.750195+00:00",
456+
"lastModifiedAt": "2022-06-25T02:59:04.750195+00:00",
458457
"lastModifiedBy": "[email protected]",
459458
"lastModifiedByType": "User"
460459
},
@@ -503,15 +502,15 @@ The output is similar to:
503502
"systemData": {
504503
"createdBy": "[email protected]",
505504
"createdByType": "User",
506-
"createdAt": "2020-06-25T02:59:04.7501955Z",
505+
"createdAt": "2022-06-25T02:59:04.7501955Z",
507506
"lastModifiedBy": "[email protected]",
508507
"lastModifiedByType": "User",
509-
"lastModifiedAt": "2020-06-25T02:59:04.7501955Z"
508+
"lastModifiedAt": "2022-06-25T02:59:04.7501955Z"
510509
},
511510
"properties": {
512511
"provisioningState": "Succeeded",
513-
"forceUpdateTag": "20200625T025902Z",
514-
"azPowerShellVersion": "3.0",
512+
"forceUpdateTag": "20220625T025902Z",
513+
"azPowerShellVersion": "8.3",
515514
"scriptContent": "\r\n param([string] $name)\r\n $output = \"Hello {0}\" -f $name\r\n Write-Output $output\r\n $DeploymentScriptOutputs = @{}\r\n $DeploymentScriptOutputs['text'] = $output\r\n ",
516515
"arguments": "-name \\\"John Dole\\\"",
517516
"retentionInterval": "P1D",
@@ -520,9 +519,9 @@ The output is similar to:
520519
"status": {
521520
"containerInstanceId": "/subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0624rg/providers/Microsoft.ContainerInstance/containerGroups/64lxews2qfa5uazscripts",
522521
"storageAccountId": "/subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0624rg/providers/Microsoft.Storage/storageAccounts/64lxews2qfa5uazscripts",
523-
"startTime": "2020-06-25T02:59:07.5951401Z",
524-
"endTime": "2020-06-25T03:00:16.7969234Z",
525-
"expirationTime": "2020-06-26T03:00:16.7969234Z"
522+
"startTime": "2022-06-25T02:59:07.5951401Z",
523+
"endTime": "2022-06-25T03:00:16.7969234Z",
524+
"expirationTime": "2022-06-26T03:00:16.7969234Z"
526525
},
527526
"outputs": {
528527
"text": "Hello John Dole"

0 commit comments

Comments
 (0)