Skip to content

Commit 156e208

Browse files
authored
Merge pull request #89 from Azure/ttw-patch-101-simple-windows-vm
patch 101 simple windows vm with reduced set of params with default values
2 parents 7948ed8 + ea22eee commit 156e208

File tree

2 files changed

+15
-29
lines changed

2 files changed

+15
-29
lines changed

101-simple-windows-vm/azuredeploy.json

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,36 @@
66
"type": "string",
77
"metadata": {
88
"description": "Unique DNS Name for the Storage Account where the Virtual Machine's disks will be placed."
9-
}
9+
},
10+
"defaultValue": "[replace(replace(tolower(concat('sa',resourceGroup().name)), '-', ''), '.','')]"
1011
},
1112
"vmName": {
1213
"type": "string",
1314
"metadata": {
1415
"description": "Name of the VM."
15-
}
16+
},
17+
"defaultValue": "[substring(replace(replace(tolower(concat('vm',resourceGroup().name)), '-', ''), '.',''),0,8)]"
1618
},
1719
"adminUsername": {
1820
"type": "string",
1921
"metadata": {
2022
"description": "Username for the Virtual Machine."
21-
}
23+
},
24+
"defaultValue": "vmadmin1"
2225
},
2326
"adminPassword": {
2427
"type": "securestring",
2528
"metadata": {
2629
"description": "The password for the Administrator account of the new VMs. Default value is subscription id"
2730
},
28-
"defaultValue": "[substring(resourcegroup().id,15,36)]"
31+
"defaultValue": "[concat('Subscription#',substring(resourcegroup().id,15,36))]"
2932
},
3033
"dnsNameForPublicIP": {
3134
"type": "string",
3235
"metadata": {
3336
"description": "Unique DNS Name for the Public IP used to access the Virtual Machine."
34-
}
37+
},
38+
"defaultValue": "[replace(replace(tolower(concat('dns',resourceGroup().name)), '-', ''), '.','')]"
3539
},
3640
"windowsOSVersion": {
3741
"type": "string",
@@ -51,19 +55,19 @@
5155
"imagePublisher": "MicrosoftWindowsServer",
5256
"imageOffer": "WindowsServer",
5357
"OSDiskName": "osdisk",
54-
"nicName": "myVnic",
58+
"nicName": "[replace(replace(tolower(concat('nic',resourceGroup().name)), '-', ''), '.','')]",
5559
"addressPrefix": "10.0.0.0/24",
56-
"subnetName": "mySubnet",
60+
"subnetName": "[replace(replace(tolower(concat('subnet',resourceGroup().name)), '-', ''), '.','')]",
5761
"subnetPrefix": "10.0.0.0/24",
5862
"storageAccountType": "Standard_LRS",
59-
"publicIPAddressName": "myPublicIP",
63+
"publicIPAddressName": "[replace(replace(tolower(concat('pip',resourceGroup().name)), '-', ''), '.','')]",
6064
"publicIPAddressType": "Dynamic",
6165
"vmStorageAccountContainerName": "vhds",
6266
"vmSize": "Standard_A1",
63-
"virtualNetworkName": "myVnet",
67+
"virtualNetworkName": "[replace(replace(tolower(concat('vnet',resourceGroup().name)), '-', ''), '.','')]",
6468
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]",
6569
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
66-
"networkSecurityGroupName": "mySG"
70+
"networkSecurityGroupName": "[replace(replace(tolower(concat('nsg',resourceGroup().name)), '-', ''), '.','')]"
6771
},
6872
"resources": [
6973
{
@@ -137,10 +141,7 @@
137141
}
138142
}
139143
}
140-
],
141-
"dhcpOptions": {
142-
"dnsServers": ["192.168.100.2"]
143-
}
144+
]
144145
}
145146
},
146147
{
@@ -153,9 +154,6 @@
153154
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
154155
],
155156
"properties": {
156-
"dnsSettings": {
157-
"dnsServers": ["192.168.100.2"]
158-
},
159157
"ipConfigurations": [
160158
{
161159
"name": "ipconfig1",

101-simple-windows-vm/azuredeploy.parameters.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
33
"contentVersion": "1.0.0.0",
44
"parameters": {
5-
"newStorageAccountName": {
6-
"value": "mystorage001"
7-
},
8-
"vmName": {
9-
"value": "myVM001"
10-
},
11-
"adminUsername": {
12-
"value": "admin123"
13-
},
14-
"dnsNameForPublicIP": {
15-
"value": "mydns001"
16-
},
175
"windowsOSVersion": {
186
"value": "2012-R2-Datacenter"
197
}

0 commit comments

Comments
 (0)