|
3 | 3 | "contentVersion": "1.0.0.0", |
4 | 4 | "parameters": { |
5 | 5 | "adminUsername": { |
6 | | - "type": "string", |
| 6 | + "type": "String", |
7 | 7 | "metadata": { |
8 | 8 | "description": "The name of the Administrator of the new VMs" |
9 | 9 | }, |
10 | | - "defaultValue": "lcladmin" |
| 10 | + "defaultValue": "vmadmin" |
11 | 11 | }, |
12 | 12 | "adminPassword": { |
13 | | - "type": "securestring", |
| 13 | + "type": "SecureString", |
14 | 14 | "metadata": { |
15 | 15 | "description": "The password for the Administrator account of the new VMs. Default value is subscription id" |
16 | 16 | }, |
17 | | - "defaultValue": "[substring(resourcegroup().id,15,36)]" |
18 | | - }, |
19 | | - "dnsServer": { |
20 | | - "type": "string", |
21 | | - "metadata": { |
22 | | - "description": "The DNS server IP address for VM internet connectivity" |
23 | | - }, |
24 | | - "defaultValue": "192.168.200.3", |
25 | | - "allowedValues": [ |
26 | | - "192.168.200.3", |
27 | | - "192.168.100.2", |
28 | | - "" |
29 | | - ] |
| 17 | + "defaultValue": "[concat('Subscription#',subscription().subscriptionId)]" |
30 | 18 | } |
31 | 19 | }, |
32 | 20 | "variables": { |
33 | 21 | "storageAccountType": "Standard_LRS", |
34 | | - "vmName": "[concat('CVM', resourceGroup().name)]", |
| 22 | + "vmName": "[tolower(concat('vm', resourceGroup().name))]", |
35 | 23 | "VMSize": "Standard_A2", |
36 | | - "dnsPrefix": "[concat('CVM', resourceGroup().name)]", |
| 24 | + "dnsPrefix": "[tolower(concat('vmdns', resourceGroup().name))]", |
37 | 25 | "vmNetworkSubnet": "10.0.0.0/24", |
38 | 26 | "virtualNetworkAddressRange": "10.0.0.0/16", |
39 | 27 | "primaryAdIpAddress": "10.0.0.4", |
|
43 | 31 | "windowsImageVersion": "latest", |
44 | 32 | "dataDiskSize": 2, |
45 | 33 | "assetLocation": "https://raw.githubusercontent.com/Azure/AzureStack-QuickStart-Templates/master/201-Comprehensive", |
46 | | - "staticSubnetName": "CVMStaticSubnet", |
| 34 | + "staticSubnetName": "vmstaticsubnet", |
47 | 35 | "subnets": [ |
48 | 36 | { |
49 | 37 | "name": "[variables('staticSubnetName')]", |
|
55 | 43 | } |
56 | 44 | } |
57 | 45 | ], |
58 | | - "virtualNetworkName": "[concat('CVMNet',resourceGroup().name)]", |
| 46 | + "virtualNetworkName": "[tolower(concat('vmvnet',resourceGroup().name))]", |
59 | 47 | "vnetID": "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]", |
60 | 48 | "staticSubnetRef": "[concat(variables('vnetID'),'/subnets/',variables('staticSubnetName'))]", |
61 | 49 | "adTemplateURL": "[concat(variables('assetLocation'),'/adVmTemplate.json')]", |
62 | | - "storageName": "[tolower(concat('CVMSA', resourceGroup().name))]", |
63 | | - "publicLBName": "[concat('CVMPLB', resourceGroup().name)]", |
64 | | - "publicIPAddressName": "[concat('CVMPIP',resourceGroup().name)]", |
65 | | - "lbFE": "[concat('CVMLBFE',resourceGroup().name)]", |
66 | | - "lbBE": "[concat('CVMLBBE',resourceGroup().name)]", |
67 | | - "rpdNAT": "[concat('CVMRDPNAT',resourceGroup().name)]", |
| 50 | + "storageName": "[tolower(concat('vmsa', resourceGroup().name))]", |
| 51 | + "publicLBName": "[tolower(concat('vmplb', resourceGroup().name))]", |
| 52 | + "publicIPAddressName": "[tolower(concat('vmpip',resourceGroup().name))]", |
| 53 | + "lbFE": "[tolower(concat('vmlbfe',resourceGroup().name))]", |
| 54 | + "lbBE": "[tolower(concat('vmlbbe',resourceGroup().name))]", |
| 55 | + "rpdNAT": "[tolower(concat('vmrdpnat',resourceGroup().name))]", |
68 | 56 | "publiclbID": "[resourceId('Microsoft.Network/loadBalancers',variables('publicLBName'))]", |
69 | 57 | "publiclbFEConfigID": "[concat(variables('publiclbID'),'/frontendIPConfigurations/',variables('lbFE'))]", |
70 | 58 | "rdpPort": 3389, |
71 | 59 | "publicBEAddressPoolID": "[concat(variables('publiclbID'),'/backendAddressPools/',variables('lbBE'))]", |
72 | 60 | "rDPNATRuleID": "[concat(variables('publiclbID'),'/inboundNatRules/',variables('rpdNAT'))]", |
73 | | - "nsgName": "[concat('CVMNsg',resourceGroup().name)]", |
| 61 | + "nsgName": "[tolower(concat('vmnsg',resourceGroup().name))]", |
74 | 62 | "nsgID": "[resourceId('Microsoft.Network/networkSecurityGroups',variables('nsgName'))]", |
75 | | - "azureStackDNSIP": "[parameters('dnsServer')]", |
76 | 63 | "apiVersion": { |
77 | 64 | "resources": { |
78 | 65 | "deployments": "2015-01-01" |
79 | 66 | }, |
80 | | - "network": "2015-05-01-preview", |
81 | | - "storage": "2015-05-01-preview", |
| 67 | + "network": "2015-06-15", |
| 68 | + "storage": "2015-06-15", |
82 | 69 | "compute": "2015-06-15" |
83 | 70 | }, |
84 | | - "NICPrefix": "[concat('NIC', resourceGroup().name)]", |
| 71 | + "NICPrefix": "[tolower(concat('vmnic', resourceGroup().name))]", |
85 | 72 | "vmContainerName": "vhds", |
86 | | - "storageAccountTemplateURL": "[concat(variables('assetLocation'),'/storageAccount.json')]", |
87 | | - "StorageAccountInfoDeployment": "StorageAccountInfoDeployment", |
88 | 73 | "WindowsFeatureName": "Web-Server", |
89 | 74 | "ModulesURL": "[concat(variables('assetLocation'),'/windowsFeature.zip')]", |
90 | 75 | "ConfigurationFunction": "windowsFeature.ps1\\EnalbeWindowsFeature", |
|
93 | 78 | }, |
94 | 79 | "resources": [ |
95 | 80 | { |
96 | | - "name": "[variables('nsgName')]", |
97 | 81 | "type": "Microsoft.Network/networkSecurityGroups", |
98 | | - "location": "[resourceGroup().location]", |
| 82 | + "name": "[variables('nsgName')]", |
99 | 83 | "apiVersion": "[variables('apiVersion').network]", |
| 84 | + "location": "[resourceGroup().location]", |
100 | 85 | "properties": { |
101 | 86 | "securityRules": [ |
102 | 87 | { |
|
116 | 101 | } |
117 | 102 | }, |
118 | 103 | { |
119 | | - "name": "[variables('virtualNetworkName')]", |
120 | 104 | "type": "Microsoft.Network/virtualNetworks", |
121 | | - "location": "[resourceGroup().location]", |
| 105 | + "name": "[variables('virtualNetworkName')]", |
122 | 106 | "apiVersion": "[variables('apiVersion').network]", |
123 | | - "dependsOn": [ |
124 | | - "[variables('nsgID')]" |
125 | | - ], |
| 107 | + "location": "[resourceGroup().location]", |
126 | 108 | "properties": { |
127 | 109 | "addressSpace": { |
128 | 110 | "addressPrefixes": [ |
|
139 | 121 | } |
140 | 122 | } |
141 | 123 | } |
142 | | - ], |
143 | | - "dhcpOptions": { |
144 | | - "dnsServers": [ |
145 | | - "[variables('azureStackDNSIP')]" |
146 | | - ] |
147 | | - } |
148 | | - } |
| 124 | + ] |
| 125 | + }, |
| 126 | + "dependsOn": [ |
| 127 | + "[variables('nsgID')]" |
| 128 | + ] |
149 | 129 | }, |
150 | 130 | { |
151 | | - "name": "[variables('publicIPAddressName')]", |
152 | 131 | "type": "Microsoft.Network/publicIPAddresses", |
153 | | - "location": "[resourceGroup().location]", |
| 132 | + "name": "[variables('publicIPAddressName')]", |
154 | 133 | "apiVersion": "[variables('apiVersion').network]", |
155 | | - "dependsOn": [ |
156 | | - "[variables('vnetID')]" |
157 | | - ], |
| 134 | + "location": "[resourceGroup().location]", |
158 | 135 | "properties": { |
159 | 136 | "publicIPAllocationMethod": "Dynamic", |
160 | 137 | "dnsSettings": { |
161 | 138 | "domainNameLabel": "[variables('dnsPrefix')]" |
162 | 139 | } |
163 | | - } |
| 140 | + }, |
| 141 | + "dependsOn": [ |
| 142 | + "[variables('vnetID')]" |
| 143 | + ] |
164 | 144 | }, |
165 | 145 | { |
166 | | - "name": "[variables('publiclbName')]", |
167 | 146 | "type": "Microsoft.Network/loadBalancers", |
168 | | - "location": "[resourceGroup().location]", |
| 147 | + "name": "[variables('publiclbName')]", |
169 | 148 | "apiVersion": "[variables('apiVersion').network]", |
170 | | - "dependsOn": [ |
171 | | - "[variables('publicIPAddressName')]" |
172 | | - ], |
| 149 | + "location": "[resourceGroup().location]", |
173 | 150 | "properties": { |
174 | 151 | "frontendIPConfigurations": [ |
175 | 152 | { |
|
195 | 172 | } |
196 | 173 | } |
197 | 174 | ] |
198 | | - } |
| 175 | + }, |
| 176 | + "dependsOn": [ |
| 177 | + "[variables('publicIPAddressName')]" |
| 178 | + ] |
199 | 179 | }, |
200 | 180 | { |
201 | | - "name": "[variables('storageName')]", |
202 | 181 | "type": "Microsoft.Storage/storageAccounts", |
203 | | - "location": "[resourceGroup().location]", |
| 182 | + "name": "[variables('storageName')]", |
204 | 183 | "apiVersion": "[variables('apiVersion').storage]", |
205 | | - "dependsOn": [ |
206 | | - "[variables('publiclbName')]" |
207 | | - ], |
| 184 | + "location": "[resourceGroup().location]", |
208 | 185 | "properties": { |
209 | 186 | "accountType": "[variables('storageAccountType')]" |
210 | | - } |
| 187 | + }, |
| 188 | + "dependsOn": [ |
| 189 | + "[variables('publiclbName')]" |
| 190 | + ] |
211 | 191 | }, |
212 | 192 | { |
213 | | - "name": "[concat(variables('NICPrefix'), '0')]", |
214 | 193 | "type": "Microsoft.Network/networkInterfaces", |
215 | | - "location": "[resourceGroup().location]", |
216 | | - "dependsOn": [ |
217 | | - "[variables('vnetID')]", |
218 | | - "[variables('publiclbName')]" |
219 | | - ], |
| 194 | + "name": "[concat(variables('NICPrefix'), '0')]", |
220 | 195 | "apiVersion": "[variables('apiVersion').network]", |
| 196 | + "location": "[resourceGroup().location]", |
221 | 197 | "properties": { |
222 | 198 | "ipConfigurations": [ |
223 | 199 | { |
|
235 | 211 | } |
236 | 212 | } |
237 | 213 | ] |
238 | | - } |
239 | | - }, |
240 | | - { |
241 | | - "name": "[concat(variables('NICPrefix'), '1')]", |
242 | | - "type": "Microsoft.Network/networkInterfaces", |
243 | | - "location": "[resourceGroup().location]", |
| 214 | + }, |
244 | 215 | "dependsOn": [ |
245 | 216 | "[variables('vnetID')]", |
246 | 217 | "[variables('publiclbName')]" |
247 | | - ], |
| 218 | + ] |
| 219 | + }, |
| 220 | + { |
| 221 | + "type": "Microsoft.Network/networkInterfaces", |
| 222 | + "name": "[concat(variables('NICPrefix'), '1')]", |
248 | 223 | "apiVersion": "[variables('apiVersion').network]", |
| 224 | + "location": "[resourceGroup().location]", |
249 | 225 | "properties": { |
250 | 226 | "ipConfigurations": [ |
251 | 227 | { |
|
258 | 234 | } |
259 | 235 | } |
260 | 236 | ] |
261 | | - } |
262 | | - }, |
263 | | - { |
264 | | - "name": "[variables('StorageAccountInfoDeployment')]", |
265 | | - "type": "Microsoft.Resources/deployments", |
266 | | - "apiVersion": "[variables('apiVersion').resources.deployments]", |
| 237 | + }, |
267 | 238 | "dependsOn": [ |
268 | | - "[resourceId('Microsoft.Storage/storageAccounts',variables('storageName'))]" |
269 | | - ], |
270 | | - "properties": { |
271 | | - "mode": "Incremental", |
272 | | - "templateLink": { |
273 | | - "uri": "[variables('storageAccountTemplateURL')]", |
274 | | - "contentVersion": "1.0.0.0" |
275 | | - }, |
276 | | - "parameters": { |
277 | | - "storageAccountName": { |
278 | | - "value": "[variables('storageName')]" |
279 | | - } |
280 | | - } |
281 | | - } |
| 239 | + "[variables('vnetID')]", |
| 240 | + "[variables('publiclbName')]" |
| 241 | + ] |
282 | 242 | }, |
283 | 243 | { |
284 | | - "name": "[concat(variables('vmName'), '0')]", |
285 | 244 | "type": "Microsoft.Compute/virtualMachines", |
286 | | - "location": "[resourceGroup().location]", |
| 245 | + "name": "[concat(variables('vmName'), '0')]", |
287 | 246 | "apiVersion": "[variables('apiVersion').compute]", |
288 | | - "dependsOn": [ |
289 | | - "[resourceId('Microsoft.Storage/storageAccounts',variables('storageName'))]", |
290 | | - "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('NICPrefix'), '0'))]", |
291 | | - "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('NICPrefix'), '1'))]" |
292 | | - ], |
| 247 | + "location": "[resourceGroup().location]", |
293 | 248 | "properties": { |
294 | 249 | "hardwareProfile": { |
295 | 250 | "vmSize": "[variables('vmSize')]" |
|
317 | 272 | "dataDisks": [ |
318 | 273 | { |
319 | 274 | "vhd": { |
320 | | - "uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storageName')),providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).primaryEndpoints.blob, variables('vmName'), '0','data-1.vhd')]" |
| 275 | + "uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storageName')),providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).primaryEndpoints.blob, variables('vmContainerName'),'/', variables('vmName'), '0','data-1.vhd')]" |
321 | 276 | }, |
322 | 277 | "name": "[concat(variables('vmName'), '0','-data-disk1')]", |
323 | 278 | "createOption": "empty", |
|
337 | 292 | } |
338 | 293 | ] |
339 | 294 | } |
340 | | - } |
| 295 | + }, |
| 296 | + "dependsOn": [ |
| 297 | + "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('NICPrefix'), '0'))]", |
| 298 | + "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('NICPrefix'), '1'))]" |
| 299 | + ] |
341 | 300 | }, |
342 | 301 | { |
343 | 302 | "type": "Microsoft.Compute/virtualMachines/extensions", |
344 | | - "name": "[concat(variables('vmName'), '0','/EnableWindowsFeature')]", |
| 303 | + "name": "[concat(variables('vmName'), '0','/DSCExtension-EnableWindowsFeature')]", |
345 | 304 | "apiVersion": "[variables('apiVersion').compute]", |
346 | 305 | "location": "[resourceGroup().location]", |
347 | | - "dependsOn": [ |
348 | | - "[concat(variables('vmName'), '0')]" |
349 | | - ], |
350 | 306 | "properties": { |
351 | 307 | "publisher": "Microsoft.Powershell", |
352 | 308 | "type": "DSC", |
|
359 | 315 | "featureName": "[variables('WindowsFeatureName')]" |
360 | 316 | } |
361 | 317 | } |
362 | | - } |
| 318 | + }, |
| 319 | + "dependsOn": [ |
| 320 | + "[concat(variables('vmName'), '0')]" |
| 321 | + ] |
363 | 322 | }, |
364 | 323 | { |
365 | 324 | "type": "Microsoft.Compute/virtualMachines/extensions", |
366 | | - "name": "[concat(variables('vmName'), '0','/BGInfo')]", |
| 325 | + "name": "[concat(variables('vmName'), '0','/BGInfoExtension')]", |
367 | 326 | "apiVersion": "[variables('apiVersion').compute]", |
368 | | - "dependsOn": [ |
369 | | - "[concat('Microsoft.Compute/virtualMachines/',variables('vmName'), '0','/extensions/EnableWindowsFeature')]" |
370 | | - ], |
371 | 327 | "location": "[resourceGroup().location]", |
372 | 328 | "properties": { |
373 | 329 | "publisher": "Microsoft.Compute", |
|
377 | 333 | "settings": { |
378 | 334 | "Properties": [ ] |
379 | 335 | } |
380 | | - } |
| 336 | + }, |
| 337 | + "dependsOn": [ |
| 338 | + "[concat('Microsoft.Compute/virtualMachines/',variables('vmName'), '0','/extensions/DSCExtension-EnableWindowsFeature')]" |
| 339 | + ] |
381 | 340 | }, |
382 | 341 | { |
383 | 342 | "type": "Microsoft.Compute/virtualMachines/extensions", |
384 | | - "name": "[concat(variables('vmName'), '0','/CustomScriptExtension')]", |
| 343 | + "name": "[concat(variables('vmName'), '0','/CustomScriptExtension-VerifyWindowsFeature')]", |
385 | 344 | "apiVersion": "[variables('apiVersion').compute]", |
386 | 345 | "location": "[resourceGroup().location]", |
387 | | - "dependsOn": [ |
388 | | - "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'), '0','/extensions/BGInfo')]" |
389 | | - ], |
390 | 346 | "properties": { |
391 | 347 | "publisher": "Microsoft.Compute", |
392 | 348 | "type": "CustomScriptExtension", |
|
398 | 354 | ], |
399 | 355 | "commandToExecute": "[concat('powershell -ExecutionPolicy Unrestricted -file ',variables('scriptFileName'), ' ', variables('WindowsFeatureName'))]" |
400 | 356 | } |
401 | | - } |
| 357 | + }, |
| 358 | + "dependsOn": [ |
| 359 | + "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'), '0','/extensions/BGInfoExtension')]" |
| 360 | + ] |
402 | 361 | } |
403 | 362 | ], |
404 | 363 | "outputs": { } |
405 | 364 | } |
| 365 | + |
0 commit comments