-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvirtualMachines.json
87 lines (87 loc) · 2.72 KB
/
virtualMachines.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
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "2017.09.01.0",
"parameters": {
"name": {
"type": "string",
"metadata": {
"description": "Specifies the name of the virtual machine. This name should be unique within the resource group."
}
},
"tags": {
"type": "object",
"metadata": {
"description": "Specifies the tags that are assigned to the virtual machine."
}
},
"plan": {
"type": "object",
"defaultValue": {},
"metadata": {
"description": "Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images."
}
},
"properties": {
"type": "object",
"metadata": {
"description": "Specifies the properties of the virtual machine."
}
},
"DependsOn": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "Pass dependencies"
}
}
},
"variables": {
"comment": {
"definition": "https://docs.microsoft.com/en-us/rest/api/compute/virtualmachines/virtualmachines-create-or-update"
},
"virtualMachineArray": [
{
"apiVersion": "2017-03-30",
"type": "Microsoft.Compute/virtualMachines",
"name": "[parameters('name')]",
"location": "[resourceGroup().location]",
"dependsOn": "[if(empty(parameters('DependsOn')),json('null'),parameters('DependsOn'))]",
"properties": "[parameters('properties')]",
"resources": []
},
{
"apiVersion": "2017-03-30",
"type": "Microsoft.Compute/virtualMachines",
"name": "[parameters('name')]",
"location": "[resourceGroup().location]",
"dependsOn": "[if(empty(parameters('DependsOn')),json('null'),parameters('DependsOn'))]",
"plan": "[parameters('plan')]",
"properties": "[parameters('properties')]",
"resources": []
}
],
"virtualMachine": "[if(empty(parameters('plan')),variables('virtualMachineArray')[0],variables('virtualMachineArray')[1])]"
},
"resources": [
{
"name": "CreateVirtualMachine",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2016-09-01",
"dependsOn": [ ],
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": "[createarray(variables('virtualMachine'))]"
}
}
}
],
"outputs": {
"virtualMachine": {
"type": "object",
"value": "[variables('virtualMachine')]"
}
}
}