Skip to content

Commit b1187e2

Browse files
authored
Merge pull request #95 from honcao/master
Fix bugs in 201-Comprehensive
2 parents 43c4616 + 58b68c6 commit b1187e2

File tree

2 files changed

+82
-128
lines changed

2 files changed

+82
-128
lines changed

201-Comprehensive/azuredeploy.json

Lines changed: 82 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,25 @@
33
"contentVersion": "1.0.0.0",
44
"parameters": {
55
"adminUsername": {
6-
"type": "string",
6+
"type": "String",
77
"metadata": {
88
"description": "The name of the Administrator of the new VMs"
99
},
10-
"defaultValue": "lcladmin"
10+
"defaultValue": "vmadmin"
1111
},
1212
"adminPassword": {
13-
"type": "securestring",
13+
"type": "SecureString",
1414
"metadata": {
1515
"description": "The password for the Administrator account of the new VMs. Default value is subscription id"
1616
},
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)]"
3018
}
3119
},
3220
"variables": {
3321
"storageAccountType": "Standard_LRS",
34-
"vmName": "[concat('CVM', resourceGroup().name)]",
22+
"vmName": "[tolower(concat('vm', resourceGroup().name))]",
3523
"VMSize": "Standard_A2",
36-
"dnsPrefix": "[concat('CVM', resourceGroup().name)]",
24+
"dnsPrefix": "[tolower(concat('vmdns', resourceGroup().name))]",
3725
"vmNetworkSubnet": "10.0.0.0/24",
3826
"virtualNetworkAddressRange": "10.0.0.0/16",
3927
"primaryAdIpAddress": "10.0.0.4",
@@ -43,7 +31,7 @@
4331
"windowsImageVersion": "latest",
4432
"dataDiskSize": 2,
4533
"assetLocation": "https://raw.githubusercontent.com/Azure/AzureStack-QuickStart-Templates/master/201-Comprehensive",
46-
"staticSubnetName": "CVMStaticSubnet",
34+
"staticSubnetName": "vmstaticsubnet",
4735
"subnets": [
4836
{
4937
"name": "[variables('staticSubnetName')]",
@@ -55,36 +43,33 @@
5543
}
5644
}
5745
],
58-
"virtualNetworkName": "[concat('CVMNet',resourceGroup().name)]",
46+
"virtualNetworkName": "[tolower(concat('vmvnet',resourceGroup().name))]",
5947
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
6048
"staticSubnetRef": "[concat(variables('vnetID'),'/subnets/',variables('staticSubnetName'))]",
6149
"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))]",
6856
"publiclbID": "[resourceId('Microsoft.Network/loadBalancers',variables('publicLBName'))]",
6957
"publiclbFEConfigID": "[concat(variables('publiclbID'),'/frontendIPConfigurations/',variables('lbFE'))]",
7058
"rdpPort": 3389,
7159
"publicBEAddressPoolID": "[concat(variables('publiclbID'),'/backendAddressPools/',variables('lbBE'))]",
7260
"rDPNATRuleID": "[concat(variables('publiclbID'),'/inboundNatRules/',variables('rpdNAT'))]",
73-
"nsgName": "[concat('CVMNsg',resourceGroup().name)]",
61+
"nsgName": "[tolower(concat('vmnsg',resourceGroup().name))]",
7462
"nsgID": "[resourceId('Microsoft.Network/networkSecurityGroups',variables('nsgName'))]",
75-
"azureStackDNSIP": "[parameters('dnsServer')]",
7663
"apiVersion": {
7764
"resources": {
7865
"deployments": "2015-01-01"
7966
},
80-
"network": "2015-05-01-preview",
81-
"storage": "2015-05-01-preview",
67+
"network": "2015-06-15",
68+
"storage": "2015-06-15",
8269
"compute": "2015-06-15"
8370
},
84-
"NICPrefix": "[concat('NIC', resourceGroup().name)]",
71+
"NICPrefix": "[tolower(concat('vmnic', resourceGroup().name))]",
8572
"vmContainerName": "vhds",
86-
"storageAccountTemplateURL": "[concat(variables('assetLocation'),'/storageAccount.json')]",
87-
"StorageAccountInfoDeployment": "StorageAccountInfoDeployment",
8873
"WindowsFeatureName": "Web-Server",
8974
"ModulesURL": "[concat(variables('assetLocation'),'/windowsFeature.zip')]",
9075
"ConfigurationFunction": "windowsFeature.ps1\\EnalbeWindowsFeature",
@@ -93,10 +78,10 @@
9378
},
9479
"resources": [
9580
{
96-
"name": "[variables('nsgName')]",
9781
"type": "Microsoft.Network/networkSecurityGroups",
98-
"location": "[resourceGroup().location]",
82+
"name": "[variables('nsgName')]",
9983
"apiVersion": "[variables('apiVersion').network]",
84+
"location": "[resourceGroup().location]",
10085
"properties": {
10186
"securityRules": [
10287
{
@@ -116,13 +101,10 @@
116101
}
117102
},
118103
{
119-
"name": "[variables('virtualNetworkName')]",
120104
"type": "Microsoft.Network/virtualNetworks",
121-
"location": "[resourceGroup().location]",
105+
"name": "[variables('virtualNetworkName')]",
122106
"apiVersion": "[variables('apiVersion').network]",
123-
"dependsOn": [
124-
"[variables('nsgID')]"
125-
],
107+
"location": "[resourceGroup().location]",
126108
"properties": {
127109
"addressSpace": {
128110
"addressPrefixes": [
@@ -139,37 +121,32 @@
139121
}
140122
}
141123
}
142-
],
143-
"dhcpOptions": {
144-
"dnsServers": [
145-
"[variables('azureStackDNSIP')]"
146-
]
147-
}
148-
}
124+
]
125+
},
126+
"dependsOn": [
127+
"[variables('nsgID')]"
128+
]
149129
},
150130
{
151-
"name": "[variables('publicIPAddressName')]",
152131
"type": "Microsoft.Network/publicIPAddresses",
153-
"location": "[resourceGroup().location]",
132+
"name": "[variables('publicIPAddressName')]",
154133
"apiVersion": "[variables('apiVersion').network]",
155-
"dependsOn": [
156-
"[variables('vnetID')]"
157-
],
134+
"location": "[resourceGroup().location]",
158135
"properties": {
159136
"publicIPAllocationMethod": "Dynamic",
160137
"dnsSettings": {
161138
"domainNameLabel": "[variables('dnsPrefix')]"
162139
}
163-
}
140+
},
141+
"dependsOn": [
142+
"[variables('vnetID')]"
143+
]
164144
},
165145
{
166-
"name": "[variables('publiclbName')]",
167146
"type": "Microsoft.Network/loadBalancers",
168-
"location": "[resourceGroup().location]",
147+
"name": "[variables('publiclbName')]",
169148
"apiVersion": "[variables('apiVersion').network]",
170-
"dependsOn": [
171-
"[variables('publicIPAddressName')]"
172-
],
149+
"location": "[resourceGroup().location]",
173150
"properties": {
174151
"frontendIPConfigurations": [
175152
{
@@ -195,29 +172,28 @@
195172
}
196173
}
197174
]
198-
}
175+
},
176+
"dependsOn": [
177+
"[variables('publicIPAddressName')]"
178+
]
199179
},
200180
{
201-
"name": "[variables('storageName')]",
202181
"type": "Microsoft.Storage/storageAccounts",
203-
"location": "[resourceGroup().location]",
182+
"name": "[variables('storageName')]",
204183
"apiVersion": "[variables('apiVersion').storage]",
205-
"dependsOn": [
206-
"[variables('publiclbName')]"
207-
],
184+
"location": "[resourceGroup().location]",
208185
"properties": {
209186
"accountType": "[variables('storageAccountType')]"
210-
}
187+
},
188+
"dependsOn": [
189+
"[variables('publiclbName')]"
190+
]
211191
},
212192
{
213-
"name": "[concat(variables('NICPrefix'), '0')]",
214193
"type": "Microsoft.Network/networkInterfaces",
215-
"location": "[resourceGroup().location]",
216-
"dependsOn": [
217-
"[variables('vnetID')]",
218-
"[variables('publiclbName')]"
219-
],
194+
"name": "[concat(variables('NICPrefix'), '0')]",
220195
"apiVersion": "[variables('apiVersion').network]",
196+
"location": "[resourceGroup().location]",
221197
"properties": {
222198
"ipConfigurations": [
223199
{
@@ -235,17 +211,17 @@
235211
}
236212
}
237213
]
238-
}
239-
},
240-
{
241-
"name": "[concat(variables('NICPrefix'), '1')]",
242-
"type": "Microsoft.Network/networkInterfaces",
243-
"location": "[resourceGroup().location]",
214+
},
244215
"dependsOn": [
245216
"[variables('vnetID')]",
246217
"[variables('publiclbName')]"
247-
],
218+
]
219+
},
220+
{
221+
"type": "Microsoft.Network/networkInterfaces",
222+
"name": "[concat(variables('NICPrefix'), '1')]",
248223
"apiVersion": "[variables('apiVersion').network]",
224+
"location": "[resourceGroup().location]",
249225
"properties": {
250226
"ipConfigurations": [
251227
{
@@ -258,38 +234,17 @@
258234
}
259235
}
260236
]
261-
}
262-
},
263-
{
264-
"name": "[variables('StorageAccountInfoDeployment')]",
265-
"type": "Microsoft.Resources/deployments",
266-
"apiVersion": "[variables('apiVersion').resources.deployments]",
237+
},
267238
"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+
]
282242
},
283243
{
284-
"name": "[concat(variables('vmName'), '0')]",
285244
"type": "Microsoft.Compute/virtualMachines",
286-
"location": "[resourceGroup().location]",
245+
"name": "[concat(variables('vmName'), '0')]",
287246
"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]",
293248
"properties": {
294249
"hardwareProfile": {
295250
"vmSize": "[variables('vmSize')]"
@@ -317,7 +272,7 @@
317272
"dataDisks": [
318273
{
319274
"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')]"
321276
},
322277
"name": "[concat(variables('vmName'), '0','-data-disk1')]",
323278
"createOption": "empty",
@@ -337,16 +292,17 @@
337292
}
338293
]
339294
}
340-
}
295+
},
296+
"dependsOn": [
297+
"[resourceId('Microsoft.Network/networkInterfaces',concat(variables('NICPrefix'), '0'))]",
298+
"[resourceId('Microsoft.Network/networkInterfaces',concat(variables('NICPrefix'), '1'))]"
299+
]
341300
},
342301
{
343302
"type": "Microsoft.Compute/virtualMachines/extensions",
344-
"name": "[concat(variables('vmName'), '0','/EnableWindowsFeature')]",
303+
"name": "[concat(variables('vmName'), '0','/DSCExtension-EnableWindowsFeature')]",
345304
"apiVersion": "[variables('apiVersion').compute]",
346305
"location": "[resourceGroup().location]",
347-
"dependsOn": [
348-
"[concat(variables('vmName'), '0')]"
349-
],
350306
"properties": {
351307
"publisher": "Microsoft.Powershell",
352308
"type": "DSC",
@@ -359,15 +315,15 @@
359315
"featureName": "[variables('WindowsFeatureName')]"
360316
}
361317
}
362-
}
318+
},
319+
"dependsOn": [
320+
"[concat(variables('vmName'), '0')]"
321+
]
363322
},
364323
{
365324
"type": "Microsoft.Compute/virtualMachines/extensions",
366-
"name": "[concat(variables('vmName'), '0','/BGInfo')]",
325+
"name": "[concat(variables('vmName'), '0','/BGInfoExtension')]",
367326
"apiVersion": "[variables('apiVersion').compute]",
368-
"dependsOn": [
369-
"[concat('Microsoft.Compute/virtualMachines/',variables('vmName'), '0','/extensions/EnableWindowsFeature')]"
370-
],
371327
"location": "[resourceGroup().location]",
372328
"properties": {
373329
"publisher": "Microsoft.Compute",
@@ -377,16 +333,16 @@
377333
"settings": {
378334
"Properties": [ ]
379335
}
380-
}
336+
},
337+
"dependsOn": [
338+
"[concat('Microsoft.Compute/virtualMachines/',variables('vmName'), '0','/extensions/DSCExtension-EnableWindowsFeature')]"
339+
]
381340
},
382341
{
383342
"type": "Microsoft.Compute/virtualMachines/extensions",
384-
"name": "[concat(variables('vmName'), '0','/CustomScriptExtension')]",
343+
"name": "[concat(variables('vmName'), '0','/CustomScriptExtension-VerifyWindowsFeature')]",
385344
"apiVersion": "[variables('apiVersion').compute]",
386345
"location": "[resourceGroup().location]",
387-
"dependsOn": [
388-
"[concat('Microsoft.Compute/virtualMachines/', variables('vmName'), '0','/extensions/BGInfo')]"
389-
],
390346
"properties": {
391347
"publisher": "Microsoft.Compute",
392348
"type": "CustomScriptExtension",
@@ -398,8 +354,12 @@
398354
],
399355
"commandToExecute": "[concat('powershell -ExecutionPolicy Unrestricted -file ',variables('scriptFileName'), ' ', variables('WindowsFeatureName'))]"
400356
}
401-
}
357+
},
358+
"dependsOn": [
359+
"[concat('Microsoft.Compute/virtualMachines/', variables('vmName'), '0','/extensions/BGInfoExtension')]"
360+
]
402361
}
403362
],
404363
"outputs": { }
405364
}
365+

201-Comprehensive/azuredeploy.parameters.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,5 @@
22
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json",
33
"contentVersion": "1.0.0.0",
44
"parameters": {
5-
"adminUsername": {
6-
"value": "lcladmin"
7-
},
8-
"adminPassword": {
9-
"value": "GEN-PASSWORD"
10-
}
115
}
126
}

0 commit comments

Comments
 (0)