-
Notifications
You must be signed in to change notification settings - Fork 125
Expand file tree
/
Copy pathdeploymentscript-basic.json
More file actions
68 lines (68 loc) · 2.01 KB
/
deploymentscript-basic.json
File metadata and controls
68 lines (68 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"type": "string",
"defaultValue": "John Dole"
},
"utcValue": {
"type": "string",
"defaultValue": "[utcNow()]"
}
},
"resources": [
{
"type": "Microsoft.Resources/deploymentScripts",
"apiVersion": "2020-10-01",
"name": "scriptInTemplate1",
"location": "[resourceGroup().location]",
"kind": "AzurePowerShell",
"properties": {
"forceUpdateTag": "[parameters('utcValue')]",
"azPowerShellVersion": "8.3",
"timeout": "PT1H",
"arguments": "[concat('-name', ' ', concat('\\\"', parameters('name'), '\\\"'))]",
"scriptContent": "
param([string] $name)
$output = 'Hello {0}' -f $name
Write-Output $output
$DeploymentScriptOutputs = @{}
$DeploymentScriptOutputs['text'] = $output
",
"cleanupPreference": "Always",
"retentionInterval": "P1D"
}
},
{
"type": "Microsoft.Resources/deploymentScripts",
"apiVersion": "2020-10-01",
"name": "scriptInTemplate2",
"location": "[resourceGroup().location]",
"kind": "AzurePowerShell",
"dependsOn": [
"scriptInTemplate1"
],
"properties": {
"forceUpdateTag": "[parameters('utcValue')]",
"azPowerShellVersion": "8.3",
"timeout": "PT1H",
"arguments": "[concat('-textToEcho', ' ', concat('\\\"', reference('scriptInTemplate1').outputs.text, '\\\"'))]",
"scriptContent": "
param([string] $textToEcho)
Write-Output $textToEcho
$DeploymentScriptOutputs = @{}
$DeploymentScriptOutputs['text'] = $textToEcho
",
"cleanupPreference": "Always",
"retentionInterval": "P1D"
}
}
],
"outputs": {
"result": {
"value": "[reference('scriptInTemplate2').outputs.text]",
"type": "string"
}
}
}