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