forked from rathishrms/AutomationVM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.json
170 lines (170 loc) · 6.71 KB
/
template.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
163
164
165
166
167
168
169
170
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"LABVMDnsName": {
"defaultValue": "labvmdnsnameupdateme",
"minLength": 1,
"type": "String"
}
},
"variables": {
"LABVMVNETPrefix": "192.168.0.0/24",
"LABVMVNETSubnet1Name": "LABVM",
"LABVMVNETSubnet1Prefix": "192.168.0.0/24",
"LABVMName": "LABVM",
"LABVMAdminUserName": "vmadmin",
"LABVMAdminPassword": "Password.1!!",
"LABVMImagePublisher": "MicrosoftWindowsDesktop",
"LABVMImageOffer": "Windows-10",
"LABVMWindowsOSVersion": "RS3-Pro",
"LABVMVmSize": "Standard_D2s_v3",
"LABVMVnetID": "[resourceId('Microsoft.Network/virtualNetworks', 'LABVMVNET')]",
"LABVMSubnetRef": "[concat(variables('LABVMVnetID'), '/subnets/', variables('LABVMVNETSubnet1Name'))]",
"LABVMNicName": "[concat(variables('LABVMName'), '-NIC')]",
"LABVM-PUBIPName": "[concat(variables('LABVMName'), '-PIP')]",
"LABVMInstallHyperVScriptFolder": ".",
"LABVMInstallHyperVScriptFileName": "VM.ps1",
"LABVMInstallHyperVURL": "https://raw.githubusercontent.com/rathishrms/AutomationVM/master/VM.ps1"
},
"resources": [
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2016-03-30",
"name": "LABVMVNET",
"location": "[resourceGroup().location]",
"dependsOn": [],
"tags": {
"displayName": "LABVMVNET"
},
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('LABVMVNETPrefix')]"
]
},
"subnets": [
{
"name": "[variables('LABVMVNETSubnet1Name')]",
"properties": {
"addressPrefix": "[variables('LABVMVNETSubnet1Prefix')]"
}
}
]
}
},
{
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2017-10-01",
"name": "[variables('LABVM-PUBIPName')]",
"location": "[resourceGroup().location]",
"dependsOn": [],
"tags": {
"displayName": "LABVM-PUBIP"
},
"properties": {
"publicIPAllocationMethod": "Dynamic",
"dnsSettings": {
"domainNameLabel": "[parameters('LABVMDnsName')]"
}
}
},
{
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2017-10-01",
"name": "[variables('LABVMNicName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', 'LABVMVNET')]",
"[resourceId('Microsoft.Network/publicIPAddresses', variables('LABVM-PUBIPName'))]"
],
"tags": {
"displayName": "LABVMNic"
},
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[variables('LABVMSubnetRef')]"
},
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('LABVM-PUBIPName'))]"
}
}
}
]
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2017-12-01",
"name": "[variables('LABVMName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Network/networkInterfaces', variables('LABVMNicName'))]"
],
"tags": {
"displayName": "LABVM"
},
"properties": {
"hardwareProfile": {
"vmSize": "[variables('LABVMVmSize')]"
},
"osProfile": {
"computerName": "[variables('LABVMName')]",
"adminUsername": "[variables('LABVMAdminUsername')]",
"adminPassword": "[variables('LABVMAdminPassword')]"
},
"storageProfile": {
"imageReference": {
"publisher": "[variables('LABVMImagePublisher')]",
"offer": "[variables('LABVMImageOffer')]",
"sku": "[variables('LABVMWindowsOSVersion')]",
"version": "latest"
},
"osDisk": {
"createOption": "FromImage",
"diskSizeGB": 1023
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('LABVMNicName'))]"
}
]
}
},
"resources": [
{
"type": "extensions",
"apiVersion": "2017-12-01",
"name": "InstallLabVMApps",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachines', variables('LABVMName'))]"
],
"tags": {
"displayName": "Install LabVM Applications"
},
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.4",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [
"[variables('LABVMInstallHyperVURL')]"
],
"commandToExecute": "[concat('powershell -ExecutionPolicy Unrestricted -File ', variables('LABVMInstallHyperVScriptFolder'), '/', variables('LABVMInstallHyperVScriptFileName'))]"
}
}
}
]
}
],
"outputs": {}
}