Skip to content

Commit d25abcb

Browse files
Merge pull request #216796 from mumian/1101-dscript-version
update azPowerShellVersion and azCliVersion
2 parents ead2178 + 561ce15 commit d25abcb

File tree

2 files changed

+45
-46
lines changed

2 files changed

+45
-46
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"

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ 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
1010
ms.custom: devx-track-azurepowershell
11-
1211
---
12+
1313
# Use deployment scripts in ARM templates
1414

1515
Learn how to use deployment scripts in Azure Resource templates (ARM templates). With a new resource type called `Microsoft.Resources/deploymentScripts`, users can execute scripts in template deployments and review execution results. These scripts can be used for performing custom steps such as:
@@ -106,7 +106,7 @@ The following JSON is an example. For more information, see the latest [template
106106
"storageAccountName": "myStorageAccount",
107107
"storageAccountKey": "myKey"
108108
},
109-
"azPowerShellVersion": "6.4", // or "azCliVersion": "2.28.0",
109+
"azPowerShellVersion": "8.3", // or "azCliVersion": "2.40.0",
110110
"arguments": "-name \\\"John Dole\\\"",
111111
"environmentVariables": [
112112
{
@@ -386,10 +386,10 @@ SubscriptionId : 01234567-89AB-CDEF-0123-456789ABCDEF
386386
ProvisioningState : Succeeded
387387
Identity : /subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/mydentity1008rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myuami
388388
ScriptKind : AzurePowerShell
389-
AzPowerShellVersion : 3.0
390-
StartTime : 6/18/2020 7:46:45 PM
391-
EndTime : 6/18/2020 7:49:45 PM
392-
ExpirationDate : 6/19/2020 7:49:45 PM
389+
AzPowerShellVersion : 8.3
390+
StartTime : 6/18/2022 7:46:45 PM
391+
EndTime : 6/18/2022 7:49:45 PM
392+
ExpirationDate : 6/19/2022 7:49:45 PM
393393
CleanupPreference : OnSuccess
394394
StorageAccountId : /subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0618rg/providers/Microsoft.Storage/storageAccounts/ftnlvo6rlrvo2azscripts
395395
ContainerInstanceId : /subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0618rg/providers/Microsoft.ContainerInstance/containerGroups/ftnlvo6rlrvo2azscripts
@@ -417,13 +417,13 @@ The list command output is similar to:
417417
[
418418
{
419419
"arguments": "-name \\\"John Dole\\\"",
420-
"azPowerShellVersion": "3.0",
420+
"azPowerShellVersion": "8.3",
421421
"cleanupPreference": "OnSuccess",
422422
"containerSettings": {
423423
"containerGroupName": null
424424
},
425425
"environmentVariables": null,
426-
"forceUpdateTag": "20200625T025902Z",
426+
"forceUpdateTag": "20220625T025902Z",
427427
"id": "/subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0624rg/providers/Microsoft.Resources/deploymentScripts/runPowerShellInlineWithOutput",
428428
"identity": {
429429
"tenantId": "01234567-89AB-CDEF-0123-456789ABCDEF",
@@ -448,19 +448,19 @@ The list command output is similar to:
448448
"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 ",
449449
"status": {
450450
"containerInstanceId": "/subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0624rg/providers/Microsoft.ContainerInstance/containerGroups/64lxews2qfa5uazscripts",
451-
"endTime": "2020-06-25T03:00:16.796923+00:00",
451+
"endTime": "2022-06-25T03:00:16.796923+00:00",
452452
"error": null,
453-
"expirationTime": "2020-06-26T03:00:16.796923+00:00",
454-
"startTime": "2020-06-25T02:59:07.595140+00:00",
453+
"expirationTime": "2022-06-26T03:00:16.796923+00:00",
454+
"startTime": "2022-06-25T02:59:07.595140+00:00",
455455
"storageAccountId": "/subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0624rg/providers/Microsoft.Storage/storageAccounts/64lxews2qfa5uazscripts"
456456
},
457457
"storageAccountSettings": null,
458458
"supportingScriptUris": null,
459459
"systemData": {
460-
"createdAt": "2020-06-25T02:59:04.750195+00:00",
460+
"createdAt": "2022-06-25T02:59:04.750195+00:00",
461461
"createdBy": "[email protected]",
462462
"createdByType": "User",
463-
"lastModifiedAt": "2020-06-25T02:59:04.750195+00:00",
463+
"lastModifiedAt": "2022-06-25T02:59:04.750195+00:00",
464464
"lastModifiedBy": "[email protected]",
465465
"lastModifiedByType": "User"
466466
},
@@ -509,15 +509,15 @@ The output is similar to:
509509
"systemData": {
510510
"createdBy": "[email protected]",
511511
"createdByType": "User",
512-
"createdAt": "2020-06-25T02:59:04.7501955Z",
512+
"createdAt": "2022-06-25T02:59:04.7501955Z",
513513
"lastModifiedBy": "[email protected]",
514514
"lastModifiedByType": "User",
515-
"lastModifiedAt": "2020-06-25T02:59:04.7501955Z"
515+
"lastModifiedAt": "2022-06-25T02:59:04.7501955Z"
516516
},
517517
"properties": {
518518
"provisioningState": "Succeeded",
519-
"forceUpdateTag": "20200625T025902Z",
520-
"azPowerShellVersion": "3.0",
519+
"forceUpdateTag": "20220625T025902Z",
520+
"azPowerShellVersion": "8.3",
521521
"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 ",
522522
"arguments": "-name \\\"John Dole\\\"",
523523
"retentionInterval": "P1D",
@@ -526,9 +526,9 @@ The output is similar to:
526526
"status": {
527527
"containerInstanceId": "/subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0624rg/providers/Microsoft.ContainerInstance/containerGroups/64lxews2qfa5uazscripts",
528528
"storageAccountId": "/subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0624rg/providers/Microsoft.Storage/storageAccounts/64lxews2qfa5uazscripts",
529-
"startTime": "2020-06-25T02:59:07.5951401Z",
530-
"endTime": "2020-06-25T03:00:16.7969234Z",
531-
"expirationTime": "2020-06-26T03:00:16.7969234Z"
529+
"startTime": "2022-06-25T02:59:07.5951401Z",
530+
"endTime": "2022-06-25T03:00:16.7969234Z",
531+
"expirationTime": "2022-06-26T03:00:16.7969234Z"
532532
},
533533
"outputs": {
534534
"text": "Hello John Dole"

0 commit comments

Comments
 (0)