1
+ {
2
+ "$schema" : " https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#" ,
3
+ "contentVersion" : " 1.0.0.0" ,
4
+ "parameters" :
5
+ {
6
+ "adminUsername" :
7
+ {
8
+ "type" : " String" ,
9
+ "metadata" :
10
+ {
11
+ "description" : " Username for the Virtual Machine."
12
+ }
13
+ }
14
+ ,
15
+ "adminPassword" :
16
+ {
17
+ "type" : " SecureString" ,
18
+ "metadata" :
19
+ {
20
+ "description" : " Password for the Virtual Machine."
21
+ }
22
+ }
23
+ ,
24
+ "windowsOSVersion" :
25
+ {
26
+ "defaultValue" : " 2012-R2-Datacenter" ,
27
+ "allowedValues" : [
28
+ " R2" ,
29
+ " 2008-R2-SP1" ,
30
+ " 2012-Datacenter" ,
31
+ " 2012-R2-Datacenter"
32
+ ],
33
+ "type" : " String" ,
34
+ "metadata" :
35
+ {
36
+ "description" : " The Windows version for the VM. This will pick a fully patched image of this given Windows version. Allowed values: 2008-R2-SP1, 2012-Datacenter, 2012-R2-Datacenter."
37
+ }
38
+ }
39
+ }
40
+ ,
41
+ "variables" :
42
+ {
43
+ "location" : " [resourceGroup().location]" ,
44
+ "imagePublisher" : " MicrosoftWindowsServer" ,
45
+ "imageOffer" : " WindowsServer" ,
46
+ "OSDiskName" : " osdiskforwindowssimple" ,
47
+ "nicName" : " mynic" ,
48
+ "addressPrefix" : " 10.0.0.0/8" ,
49
+ "subnetName" : " Subnet11" ,
50
+ "subnetPrefix" : " 10.0.0.0/16" ,
51
+ "storageAccountType" : " Standard_LRS" ,
52
+ "publicIPAddressName" : " myip" ,
53
+ "publicIPAddressType" : " Dynamic" ,
54
+ "vmStorageAccountContainerName" : " vhds" ,
55
+ "vmName" : " myVMDataDisk" ,
56
+ "vmSize" : " Standard_A1" ,
57
+ "virtualNetworkName" : " myvnet" ,
58
+ "vnetID" : " [resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]" ,
59
+ "subnetRef" : " [concat(variables('vnetID'),'/subnets/',variables('subnetName'))]" ,
60
+ "apiVersion" : " 2015-06-15" ,
61
+ "computeResouresApiVersion" : " 2016-04-30-preview" ,
62
+ "dnsLabelPrefix" : " [toLower(resourceGroup().name)]"
63
+ }
64
+ ,
65
+ "resources" : [
66
+ {
67
+ "type" : " Microsoft.Network/publicIPAddresses" ,
68
+ "name" : " [variables('publicIPAddressName')]" ,
69
+ "apiVersion" : " [variables('apiVersion')]" ,
70
+ "location" : " [variables('location')]" ,
71
+ "properties" : {
72
+ "publicIPAllocationMethod" : " [variables('publicIPAddressType')]" ,
73
+ "dnsSettings" : {
74
+ "domainNameLabel" : " [variables('dnsLabelPrefix')]"
75
+ }
76
+ }
77
+ }
78
+ ,
79
+ {
80
+ "type" : " Microsoft.Network/virtualNetworks" ,
81
+ "name" : " [variables('virtualNetworkName')]" ,
82
+ "apiVersion" : " [variables('apiVersion')]" ,
83
+ "location" : " [variables('location')]" ,
84
+ "properties" :
85
+ {
86
+ "addressSpace" :
87
+ {
88
+ "addressPrefixes" : [
89
+ " [variables('addressPrefix')]"
90
+ ]
91
+ }
92
+ ,
93
+ "subnets" : [
94
+ {
95
+ "name" : " [variables('subnetName')]" ,
96
+ "properties" :
97
+ {
98
+ "addressPrefix" : " [variables('subnetPrefix')]"
99
+ }
100
+ }
101
+ ]
102
+ }
103
+ }
104
+ ,
105
+ {
106
+ "type" : " Microsoft.Network/networkInterfaces" ,
107
+ "name" : " [variables('nicName')]" ,
108
+ "apiVersion" : " [variables('apiVersion')]" ,
109
+ "location" : " [variables('location')]" ,
110
+ "properties" :
111
+ {
112
+ "ipConfigurations" : [
113
+ {
114
+ "name" : " ipconfig1" ,
115
+ "properties" :
116
+ {
117
+ "privateIPAllocationMethod" : " Dynamic" ,
118
+ "publicIPAddress" :
119
+ {
120
+ "id" : " [resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"
121
+ }
122
+ ,
123
+ "subnet" :
124
+ {
125
+ "id" : " [variables('subnetRef')]"
126
+ }
127
+ }
128
+ }
129
+ ]
130
+ }
131
+ ,
132
+ "dependsOn" : [
133
+ " [concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]" ,
134
+ " [concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
135
+ ]
136
+ }
137
+ ,
138
+ {
139
+ "type" : " Microsoft.Compute/disks" ,
140
+ "name" : " myManagedDataDisk" ,
141
+ "apiVersion" : " [variables('computeResouresApiVersion')]" ,
142
+ "location" : " [variables('location')]" ,
143
+ "properties" :
144
+ {
145
+ "creationData" :
146
+ {
147
+ "createOption" : " Empty"
148
+ }
149
+ ,
150
+ "accountType" : " [variables('storageAccountType')]" ,
151
+ "diskSizeGB" : 64
152
+ }
153
+ }
154
+ ,
155
+ {
156
+ "type" : " Microsoft.Compute/disks" ,
157
+ "name" : " myManagedDataDisk1" ,
158
+ "apiVersion" : " [variables('computeResouresApiVersion')]" ,
159
+ "location" : " [variables('location')]" ,
160
+ "properties" :
161
+ {
162
+ "creationData" :
163
+ {
164
+ "createOption" : " Empty"
165
+ }
166
+ ,
167
+ "accountType" : " [variables('storageAccountType')]" ,
168
+ "diskSizeGB" : 128
169
+ }
170
+ }
171
+ ,
172
+ {
173
+ "type" : " Microsoft.Compute/virtualMachines" ,
174
+ "name" : " [variables('vmName')]" ,
175
+ "apiVersion" : " [variables('computeResouresApiVersion')]" ,
176
+ "location" : " [variables('location')]" ,
177
+ "properties" :
178
+ {
179
+ "hardwareProfile" :
180
+ {
181
+ "vmSize" : " [variables('vmSize')]"
182
+ }
183
+ ,
184
+ "osProfile" :
185
+ {
186
+ "computerName" : " [variables('vmName')]" ,
187
+ "adminUsername" : " [parameters('adminUsername')]" ,
188
+ "adminPassword" : " [parameters('adminPassword')]"
189
+ }
190
+ ,
191
+ "storageProfile" :
192
+ {
193
+ "imageReference" :
194
+ {
195
+ "publisher" : " [variables('imagePublisher')]" ,
196
+ "offer" : " [variables('imageOffer')]" ,
197
+ "sku" : " [parameters('windowsOSVersion')]" ,
198
+ "version" : " latest"
199
+ }
200
+ ,
201
+ "osDisk" :
202
+ {
203
+ "name" : " myOSDisk" ,
204
+ "createOption" : " fromImage"
205
+ }
206
+ ,
207
+ "dataDisks" : [
208
+ {
209
+ "lun" : 2 ,
210
+ "name" : " myManagedDataDisk" ,
211
+ "createOption" : " attach" ,
212
+ "managedDisk" :
213
+ {
214
+ "id" : " [resourceId('Microsoft.Compute/disks', 'myManagedDataDisk')]"
215
+ }
216
+ }
217
+ ,
218
+ {
219
+ "lun" : 3 ,
220
+ "name" : " myManagedDataDisk1" ,
221
+ "createOption" : " attach" ,
222
+ "managedDisk" :
223
+ {
224
+ "id" : " [resourceId('Microsoft.Compute/disks', 'myManagedDataDisk1')]"
225
+ }
226
+ }
227
+ ]
228
+ }
229
+ ,
230
+ "networkProfile" :
231
+ {
232
+ "networkInterfaces" : [
233
+ {
234
+ "id" : " [resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]"
235
+ }
236
+ ]
237
+ }
238
+ }
239
+ ,
240
+ "dependsOn" : [
241
+ " [concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]" ,
242
+ " Microsoft.Compute/disks/myManagedDataDisk"
243
+ ]
244
+ }
245
+ ]
246
+ }
0 commit comments