forked from Azure/azure-quickstart-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazuredeploy.json
162 lines (162 loc) · 5.54 KB
/
azuredeploy.json
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"type": "string",
"metadata": {
"description": "User name for the Virtual Machine."
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Password for the Virtual Machine."
}
},
"aadClientID": {
"metadata": {
"description": "Client ID of AAD app which has permissions to KeyVault"
},
"type": "string"
},
"aadClientSecret": {
"metadata": {
"description": "Client Secret of AAD app which has permissions to KeyVault"
},
"type": "securestring"
},
"keyVaultName": {
"type": "string",
"metadata": {
"description": "Name of the KeyVault to place the volume encryption key"
}
},
"keyVaultResourceGroup": {
"type": "string",
"metadata": {
"description": "Resource group of the KeyVault"
}
},
"vmName": {
"type": "string",
"metadata": {
"description": "Name of the VM that will be created"
}
},
"_artifactsLocation": {
"type": "string",
"defaultValue": "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master",
"metadata": {
"description": "The base URI where artifacts required by this template are located. When the template is deployed using the accompanying scripts, a private location in the subscription will be used and this value will be automatically generated."
}
},
"_artifactsLocationSasToken": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated."
}
}
},
"variables": {
"templateName": "101-vm-full-disk-encrypted-rhel",
"createVmUrl": "[concat(parameters('_artifactsLocation'), '/', '101-vm-simple-rhel', '/', 'azuredeploy.json', parameters('_artifactsLocationSasToken'))]",
"createVmDeploymentName": "[concat(uniquestring(parameters('vmName')), 'createVm')]",
"encryptVmUrl": "[concat(parameters('_artifactsLocation'), '/', '201-encrypt-running-linux-vm', '/', 'azuredeploy.json', parameters('_artifactsLocationSasToken'))]",
"encryptVmDeploymentName": "[concat(uniquestring(parameters('vmName')), 'encryptVm')]",
"scriptsFolder": "scripts",
"scriptFileName": "setup_raid.sh",
"setupRaidUrl": "[concat(parameters('_artifactsLocation'), '/', variables('templateName'), '/', variables('scriptsFolder'), '/', variables('scriptFileName'), parameters('_artifactsLocationSasToken'))]",
"setupRaidExtensionName": "setupRaidCustomScript",
"diskFormatQuery": "{\"dev_path\":\"/dev/md0\",\"name\":\"encryptedraid\",\"file_system\":\"ext4\"}"
},
"resources": [
{
"apiVersion": "2016-02-01",
"name": "[variables('createVmDeploymentName')]",
"type": "Microsoft.Resources/deployments",
"properties": {
"mode": "Incremental",
"parameters": {
"adminUsername": {
"value": "[parameters('adminUsername')]"
},
"adminPassword": {
"value": "[parameters('adminPassword')]"
},
"vmName": {
"value": "[parameters('vmName')]"
}
},
"templateLink": {
"contentVersion": "1.0.0.0",
"uri": "[variables('createVmUrl')]"
}
}
},
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(parameters('vmName'), '/', variables('setupRaidExtensionName'))]",
"apiVersion": "2016-04-30-preview",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Resources/deployments', variables('createVmDeploymentName'))]"
],
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [
"[variables('setupRaidUrl')]"
],
"commandToExecute": "./setup_raid.sh"
},
"protectedSettings": {}
}
},
{
"apiVersion": "2016-02-01",
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachines/extensions', parameters('vmName'), variables('setupRaidExtensionName'))]"
],
"name": "[variables('encryptVmDeploymentName')]",
"type": "Microsoft.Resources/deployments",
"properties": {
"mode": "Incremental",
"parameters": {
"encryptionOperation": {
"value": "EnableEncryptionFormat"
},
"volumeType": {
"value": "All"
},
"diskFormatQuery": {
"value": "[variables('diskFormatQuery')]"
},
"aadClientID": {
"value": "[parameters('aadClientID')]"
},
"aadClientSecret": {
"value": "[parameters('aadClientSecret')]"
},
"keyVaultName": {
"value": "[parameters('keyVaultName')]"
},
"keyVaultResourceGroup": {
"value": "[parameters('keyVaultResourceGroup')]"
},
"vmName": {
"value": "[parameters('vmName')]"
}
},
"templateLink": {
"contentVersion": "1.0.0.0",
"uri": "[variables('encryptVmUrl')]"
}
}
}
]
}