@@ -5,11 +5,11 @@ services: azure-resource-manager
5
5
author : mumian
6
6
ms.service : azure-resource-manager
7
7
ms.topic : conceptual
8
- ms.date : 10/26 /2022
8
+ ms.date : 11/01 /2022
9
9
ms.author : jgao
10
10
ms.custom : devx-track-azurepowershell
11
-
12
11
---
12
+
13
13
# Use deployment scripts in ARM templates
14
14
15
15
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
106
106
"storageAccountName" : " myStorageAccount" ,
107
107
"storageAccountKey" : " myKey"
108
108
},
109
- "azPowerShellVersion" : " 6.4 " , // or "azCliVersion": "2.28 .0",
109
+ "azPowerShellVersion" : " 8.3 " , // or "azCliVersion": "2.40 .0",
110
110
"arguments" : " -name \\\" John Dole\\\" " ,
111
111
"environmentVariables" : [
112
112
{
@@ -386,10 +386,10 @@ SubscriptionId : 01234567-89AB-CDEF-0123-456789ABCDEF
386
386
ProvisioningState : Succeeded
387
387
Identity : /subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/mydentity1008rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myuami
388
388
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
393
393
CleanupPreference : OnSuccess
394
394
StorageAccountId : /subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0618rg/providers/Microsoft.Storage/storageAccounts/ftnlvo6rlrvo2azscripts
395
395
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:
417
417
[
418
418
{
419
419
"arguments" : " -name \\\" John Dole\\\" " ,
420
- "azPowerShellVersion" : " 3.0 " ,
420
+ "azPowerShellVersion" : " 8.3 " ,
421
421
"cleanupPreference" : " OnSuccess" ,
422
422
"containerSettings" : {
423
423
"containerGroupName" : null
424
424
},
425
425
"environmentVariables" : null ,
426
- "forceUpdateTag" : " 20200625T025902Z " ,
426
+ "forceUpdateTag" : " 20220625T025902Z " ,
427
427
"id" : " /subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0624rg/providers/Microsoft.Resources/deploymentScripts/runPowerShellInlineWithOutput" ,
428
428
"identity" : {
429
429
"tenantId" : " 01234567-89AB-CDEF-0123-456789ABCDEF" ,
@@ -448,19 +448,19 @@ The list command output is similar to:
448
448
"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 " ,
449
449
"status" : {
450
450
"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" ,
452
452
"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" ,
455
455
"storageAccountId" : " /subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0624rg/providers/Microsoft.Storage/storageAccounts/64lxews2qfa5uazscripts"
456
456
},
457
457
"storageAccountSettings" : null ,
458
458
"supportingScriptUris" : null ,
459
459
"systemData" : {
460
- "createdAt" : " 2020 -06-25T02:59:04.750195+00:00" ,
460
+ "createdAt" : " 2022 -06-25T02:59:04.750195+00:00" ,
461
461
462
462
"createdByType" : " User" ,
463
- "lastModifiedAt" : " 2020 -06-25T02:59:04.750195+00:00" ,
463
+ "lastModifiedAt" : " 2022 -06-25T02:59:04.750195+00:00" ,
464
464
"lastModifiedBy" :
" [email protected] " ,
465
465
"lastModifiedByType" : " User"
466
466
},
@@ -509,15 +509,15 @@ The output is similar to:
509
509
"systemData" : {
510
510
511
511
"createdByType" : " User" ,
512
- "createdAt" : " 2020 -06-25T02:59:04.7501955Z" ,
512
+ "createdAt" : " 2022 -06-25T02:59:04.7501955Z" ,
513
513
"lastModifiedBy" :
" [email protected] " ,
514
514
"lastModifiedByType" : " User" ,
515
- "lastModifiedAt" : " 2020 -06-25T02:59:04.7501955Z"
515
+ "lastModifiedAt" : " 2022 -06-25T02:59:04.7501955Z"
516
516
},
517
517
"properties" : {
518
518
"provisioningState" : " Succeeded" ,
519
- "forceUpdateTag" : " 20200625T025902Z " ,
520
- "azPowerShellVersion" : " 3.0 " ,
519
+ "forceUpdateTag" : " 20220625T025902Z " ,
520
+ "azPowerShellVersion" : " 8.3 " ,
521
521
"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 " ,
522
522
"arguments" : " -name \\\" John Dole\\\" " ,
523
523
"retentionInterval" : " P1D" ,
@@ -526,9 +526,9 @@ The output is similar to:
526
526
"status" : {
527
527
"containerInstanceId" : " /subscriptions/01234567-89AB-CDEF-0123-456789ABCDEF/resourceGroups/myds0624rg/providers/Microsoft.ContainerInstance/containerGroups/64lxews2qfa5uazscripts" ,
528
528
"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"
532
532
},
533
533
"outputs" : {
534
534
"text" : " Hello John Dole"
0 commit comments