-
Notifications
You must be signed in to change notification settings - Fork 1
/
template.json
694 lines (694 loc) · 26.6 KB
/
template.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"nestedTemplatesLocation": {
"type": "string",
"metadata": {
"description": "The base URI where artifacts required by this template are located."
},
"defaultValue": "https://wvdportalstorageblob.blob.core.windows.net/galleryartifacts/armtemplates/Hostpool_10-05-2022/nestedTemplates/"
},
"artifactsLocation": {
"type": "string",
"metadata": {
"description": "The base URI where artifacts required by this template are located."
}
},
"hostpoolName": {
"type": "string",
"metadata": {
"description": "The name of the Hostpool to be created."
}
},
"hostpoolToken": {
"type": "securestring",
"metadata": {
"description": "The token of the host pool where the session hosts will be added."
}
},
"hostpoolResourceGroup": {
"type": "string",
"metadata": {
"description": "The resource group of the host pool to be updated. Used when the host pool was created empty."
},
"defaultValue": ""
},
"hostpoolLocation": {
"type": "string",
"metadata": {
"description": "The location of the host pool to be updated. Used when the host pool was created empty."
},
"defaultValue": ""
},
"hostpoolProperties": {
"type": "object",
"metadata": {
"description": "The properties of the Hostpool to be updated. Used when the host pool was created empty."
},
"defaultValue": {}
},
"vmTemplate": {
"type": "string",
"metadata": {
"description": "The host pool VM template. Used when the host pool was created empty."
},
"defaultValue": ""
},
"administratorAccountUsername": {
"type": "string",
"metadata": {
"description": "A username in the domain that has privileges to join the session hosts to the domain. For example, 'vmjoiner@contoso.com'."
},
"defaultValue": ""
},
"administratorAccountPassword": {
"type": "securestring",
"metadata": {
"description": "The password that corresponds to the existing domain username."
},
"defaultValue": ""
},
"vmAdministratorAccountUsername": {
"type": "string",
"metadata": {
"description": "A username to be used as the virtual machine administrator account. The vmAdministratorAccountUsername and vmAdministratorAccountPassword parameters must both be provided. Otherwise, domain administrator credentials provided by administratorAccountUsername and administratorAccountPassword will be used."
},
"defaultValue": ""
},
"vmAdministratorAccountPassword": {
"type": "securestring",
"metadata": {
"description": "The password associated with the virtual machine administrator account. The vmAdministratorAccountUsername and vmAdministratorAccountPassword parameters must both be provided. Otherwise, domain administrator credentials provided by administratorAccountUsername and administratorAccountPassword will be used."
},
"defaultValue": ""
},
"availabilityOption": {
"type": "string",
"metadata": {
"description": "Select the availability options for the VMs."
},
"defaultValue": "AvailabilityZone",
"allowedValues": [
"None",
"AvailabilitySet",
"AvailabilityZone"
]
},
"availabilitySetName": {
"type": "string",
"metadata": {
"description": "The name of avaiability set to be used when create the VMs."
},
"defaultValue": ""
},
"createAvailabilitySet": {
"type": "bool",
"metadata": {
"description": "Whether to create a new availability set for the VMs."
},
"defaultValue": false
},
"availabilitySetUpdateDomainCount": {
"type": "int",
"metadata": {
"description": "The platform update domain count of avaiability set to be created."
},
"defaultValue": 5,
"allowedValues": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20
]
},
"availabilitySetFaultDomainCount": {
"type": "int",
"metadata": {
"description": "The platform fault domain count of avaiability set to be created."
},
"defaultValue": 2,
"allowedValues": [
1,
2,
3
]
},
"availabilityZones": {
"type": "array",
"metadata": {
"description": "The availability zones to equally distribute VMs amongst"
},
"defaultValue": []
},
"vmResourceGroup": {
"type": "string",
"metadata": {
"description": "The resource group of the session host VMs."
}
},
"vmLocation": {
"type": "string",
"metadata": {
"description": "The location of the session host VMs."
}
},
"vmSize": {
"type": "string",
"metadata": {
"description": "The size of the session host VMs."
}
},
"vmDiskSizeGB": {
"type": "int",
"metadata": {
"description": "The size of the session host VMs in GB. If the value of this parameter is 0, the disk will be created with the default size set in the image."
},
"defaultValue": 0
},
"vmHibernate": {
"type": "bool",
"metadata": {
"description": "Whether the VMs created will be hibernate enabled"
},
"defaultValue": false
},
"vmInitialNumber": {
"type": "int",
"metadata": {
"description": "VM name prefix initial number."
}
},
"vmNumberOfInstances": {
"type": "int",
"metadata": {
"description": "Number of session hosts that will be created and added to the hostpool."
}
},
"vmNamePrefix": {
"type": "string",
"metadata": {
"description": "This prefix will be used in combination with the VM number to create the VM name. If using 'rdsh' as the prefix, VMs would be named 'rdsh-0', 'rdsh-1', etc. You should use a unique prefix to reduce name collisions in Active Directory."
}
},
"vmImageType": {
"type": "string",
"metadata": {
"description": "Select the image source for the session host vms. VMs from a Gallery image will be created with Managed Disks."
},
"defaultValue": "Gallery",
"allowedValues": [
"CustomImage",
"Gallery"
]
},
"vmGalleryImageOffer": {
"type": "string",
"metadata": {
"description": "(Required when vmImageType = Gallery) Gallery image Offer."
},
"defaultValue": ""
},
"vmGalleryImagePublisher": {
"type": "string",
"metadata": {
"description": "(Required when vmImageType = Gallery) Gallery image Publisher."
},
"defaultValue": ""
},
"vmGalleryImageSKU": {
"type": "string",
"metadata": {
"description": "(Required when vmImageType = Gallery) Gallery image SKU."
},
"defaultValue": ""
},
"vmGalleryImageVersion": {
"type": "string",
"metadata": {
"description": "(Required when vmImageType = Gallery) Gallery image version."
},
"defaultValue": ""
},
"vmGalleryImageHasPlan": {
"type": "bool",
"metadata": {
"description": "Whether the VM has plan or not"
},
"defaultValue": false
},
"vmCustomImageSourceId": {
"type": "string",
"metadata": {
"description": "(Required when vmImageType = CustomImage) Resource ID of the image"
},
"defaultValue": ""
},
"vmDiskType": {
"type": "string",
"allowedValues": [
"UltraSSD_LRS",
"Premium_LRS",
"StandardSSD_LRS",
"Standard_LRS"
],
"metadata": {
"description": "The VM disk type for the VM: HDD or SSD."
}
},
"existingVnetName": {
"type": "string",
"metadata": {
"description": "The name of the virtual network the VMs will be connected to."
}
},
"existingSubnetName": {
"type": "string",
"metadata": {
"description": "The subnet the VMs will be placed in."
}
},
"virtualNetworkResourceGroupName": {
"type": "string",
"metadata": {
"description": "The resource group containing the existing virtual network."
}
},
"createNetworkSecurityGroup": {
"type": "bool",
"metadata": {
"description": "Whether to create a new network security group or use an existing one"
},
"defaultValue": false
},
"networkSecurityGroupId": {
"type": "string",
"metadata": {
"description": "The resource id of an existing network security group"
},
"defaultValue": ""
},
"networkSecurityGroupRules": {
"type": "array",
"metadata": {
"description": "The rules to be given to the new network security group"
},
"defaultValue": []
},
"availabilitySetTags": {
"type": "object",
"metadata": {
"description": "The tags to be assigned to the availability set"
},
"defaultValue": {}
},
"networkInterfaceTags": {
"type": "object",
"metadata": {
"description": "The tags to be assigned to the network interfaces"
},
"defaultValue": {}
},
"networkSecurityGroupTags": {
"type": "object",
"metadata": {
"description": "The tags to be assigned to the network security groups"
},
"defaultValue": {}
},
"virtualMachineTags": {
"type": "object",
"metadata": {
"description": "The tags to be assigned to the virtual machines"
},
"defaultValue": {}
},
"imageTags": {
"type": "object",
"metadata": {
"description": "The tags to be assigned to the images"
},
"defaultValue": {}
},
"deploymentId": {
"type": "string",
"metadata": {
"description": "GUID for the deployment"
},
"defaultValue": ""
},
"apiVersion": {
"type": "string",
"metadata": {
"description": "WVD api version"
},
"defaultValue": "2019-12-10-preview"
},
"ouPath": {
"type": "string",
"metadata": {
"description": "OUPath for the domain join"
},
"defaultValue": ""
},
"domain": {
"type": "string",
"metadata": {
"description": "Domain to join"
},
"defaultValue": ""
},
"aadJoin": {
"type": "bool",
"metadata": {
"description": "IMPORTANT: You can use this parameter for the test purpose only as AAD Join is public preview. True if AAD Join, false if AD join"
},
"defaultValue": false
},
"intune": {
"type": "bool",
"metadata": {
"description": "IMPORTANT: Please don't use this parameter as intune enrollment is not supported yet. True if intune enrollment is selected. False otherwise"
},
"defaultValue": false
},
"bootDiagnostics": {
"type": "object",
"metadata": {
"description": "Boot diagnostics object taken as body of Diagnostics Profile in VM creation"
},
"defaultValue": {
"enabled": false
}
},
"userAssignedIdentity": {
"type": "string",
"metadata": {
"description": "The name of user assigned identity that will assigned to the VMs. This is an optional parameter."
},
"defaultValue": ""
},
"customConfigurationTemplateUrl": {
"type": "string",
"metadata": {
"description": "ARM template that contains custom configurations to be run after the virtual machines are created."
},
"defaultValue": ""
},
"customConfigurationParameterUrl": {
"type": "string",
"metadata": {
"description": "Url to the ARM template parameter file for the customConfigurationTemplateUrl parameter. This input will be used when the template is ran after the VMs have been deployed."
},
"defaultValue": ""
},
"systemData": {
"type": "object",
"metadata": {
"description": "System data is used for internal purposes, such as support preview features."
},
"defaultValue": {}
},
"securityType": {
"type": "string",
"metadata": {
"description": "Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to enable UefiSettings. Default: UefiSettings will not be enabled unless this property is set as TrustedLaunch."
},
"defaultValue": ""
},
"secureBoot": {
"type": "bool",
"metadata": {
"description": "Specifies whether secure boot should be enabled on the virtual machine."
},
"defaultValue": false
},
"vTPM": {
"type": "bool",
"metadata": {
"description": "Specifies whether vTPM (Virtual Trusted Platform Module) should be enabled on the virtual machine."
},
"defaultValue": false
}
},
"variables": {
"rdshPrefix": "[concat(parameters('vmNamePrefix'),'-')]",
"vhds": "[concat('vhds','/', variables('rdshPrefix'))]",
"subnet-id": "[resourceId(parameters('virtualNetworkResourceGroupName'),'Microsoft.Network/virtualNetworks/subnets',parameters('existingVnetName'), parameters('existingSubnetName'))]",
"vmTemplateName": "[concat( 'managedDisks-', toLower(replace(parameters('vmImageType'),' ', '')), 'vm')]",
"vmTemplateUri": "[concat(parameters('nestedTemplatesLocation'), variables('vmTemplateName'),'.json')]",
"rdshVmNamesOutput": {
"copy": [
{
"name": "rdshVmNamesCopy",
"count": "[parameters('vmNumberOfInstances')]",
"input": {
"name": "[concat(variables('rdshPrefix'), add(parameters('vmInitialNumber'), copyIndex('rdshVmNamesCopy')))]"
}
}
]
}
},
"resources": [
{
"apiVersion": "2018-05-01",
"name": "[concat('UpdateHostPool-', parameters('deploymentId'))]",
"type": "Microsoft.Resources/deployments",
"resourceGroup": "[parameters('hostpoolResourceGroup')]",
"condition": "[not(empty(parameters('hostpoolResourceGroup')))]",
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "[parameters('hostpoolName')]",
"apiVersion": "[parameters('apiVersion')]",
"location": "[parameters('hostpoolLocation')]",
"type": "Microsoft.DesktopVirtualization/hostpools",
"properties": "[parameters('hostpoolProperties')]"
}
]
}
}
},
{
"apiVersion": "2018-05-01",
"name": "[concat('AVSet-linkedTemplate-', parameters('deploymentId'))]",
"type": "Microsoft.Resources/deployments",
"resourceGroup": "[parameters('vmResourceGroup')]",
"condition": "[and(equals(parameters('availabilityOption'), 'AvailabilitySet'), parameters('createAvailabilitySet'))]",
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"apiVersion": "2018-10-01",
"type": "Microsoft.Compute/availabilitySets",
"name": "[parameters('availabilitySetName')]",
"location": "[parameters('vmLocation')]",
"tags": "[parameters('availabilitySetTags')]",
"properties": {
"platformUpdateDomainCount": "[parameters('availabilitySetUpdateDomainCount')]",
"platformFaultDomainCount": "[parameters('availabilitySetFaultDomainCount')]"
},
"sku": {
"name": "Aligned"
}
}
]
}
},
"dependsOn": [
"[concat('UpdateHostPool-', parameters('deploymentId'))]"
]
},
{
"apiVersion": "2018-05-01",
"name": "[concat('vmCreation-linkedTemplate-', parameters('deploymentId'))]",
"resourceGroup": "[parameters('vmResourceGroup')]",
"dependsOn": [
"[concat('AVSet-linkedTemplate-', parameters('deploymentId'))]"
],
"type": "Microsoft.Resources/deployments",
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[variables('vmTemplateUri')]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"artifactsLocation": {
"value": "[parameters('artifactsLocation')]"
},
"availabilityOption": {
"value": "[parameters('availabilityOption')]"
},
"availabilitySetName": {
"value": "[parameters('availabilitySetName')]"
},
"availabilityZones": {
"value": "[parameters('availabilityZones')]"
},
"vmGalleryImageOffer": {
"value": "[parameters('vmGalleryImageOffer')]"
},
"vmGalleryImagePublisher": {
"value": "[parameters('vmGalleryImagePublisher')]"
},
"vmGalleryImageHasPlan": {
"value": "[parameters('vmGalleryImageHasPlan')]"
},
"vmGalleryImageSKU": {
"value": "[parameters('vmGalleryImageSKU')]"
},
"vmGalleryImageVersion": {
"value": "[parameters('vmGalleryImageVersion')]"
},
"rdshPrefix": {
"value": "[variables('rdshPrefix')]"
},
"rdshNumberOfInstances": {
"value": "[parameters('vmNumberOfInstances')]"
},
"rdshVMDiskType": {
"value": "[parameters('vmDiskType')]"
},
"rdshVmSize": {
"value": "[parameters('vmSize')]"
},
"rdshVmDiskSizeGB": {
"value": "[parameters('vmDiskSizeGB')]"
},
"rdshHibernate": {
"value": "[parameters('vmHibernate')]"
},
"enableAcceleratedNetworking": {
"value": false
},
"vmAdministratorAccountUsername": {
"value": "[parameters('vmAdministratorAccountUsername')]"
},
"vmAdministratorAccountPassword": {
"value": "[parameters('vmAdministratorAccountPassword')]"
},
"administratorAccountUsername": {
"value": "[parameters('administratorAccountUsername')]"
},
"administratorAccountPassword": {
"value": "[parameters('administratorAccountPassword')]"
},
"subnet-id": {
"value": "[variables('subnet-id')]"
},
"vhds": {
"value": "[variables('vhds')]"
},
"rdshImageSourceId": {
"value": "[parameters('vmCustomImageSourceId')]"
},
"location": {
"value": "[parameters('vmLocation')]"
},
"createNetworkSecurityGroup": {
"value": "[parameters('createNetworkSecurityGroup')]"
},
"networkSecurityGroupId": {
"value": "[parameters('networkSecurityGroupId')]"
},
"networkSecurityGroupRules": {
"value": "[parameters('networkSecurityGroupRules')]"
},
"networkInterfaceTags": {
"value": "[parameters('networkInterfaceTags')]"
},
"networkSecurityGroupTags": {
"value": "[parameters('networkSecurityGroupTags')]"
},
"virtualMachineTags": {
"value": "[parameters('virtualMachineTags')]"
},
"imageTags": {
"value": "[parameters('imageTags')]"
},
"vmInitialNumber": {
"value": "[parameters('vmInitialNumber')]"
},
"hostpoolName": {
"value": "[parameters('hostpoolName')]"
},
"hostpoolToken": {
"value": "[parameters('hostpoolToken')]"
},
"domain": {
"value": "[parameters('domain')]"
},
"ouPath": {
"value": "[parameters('ouPath')]"
},
"aadJoin": {
"value": "[parameters('aadJoin')]"
},
"intune": {
"value": "[parameters('intune')]"
},
"bootDiagnostics": {
"value": "[parameters('bootDiagnostics')]"
},
"_guidValue": {
"value": "[parameters('deploymentId')]"
},
"userAssignedIdentity": {
"value": "[parameters('userAssignedIdentity')]"
},
"customConfigurationTemplateUrl": {
"value": "[parameters('customConfigurationTemplateUrl')]"
},
"customConfigurationParameterUrl": {
"value": "[parameters('customConfigurationParameterUrl')]"
},
"SessionHostConfigurationVersion": {
"value": "[if(contains(parameters('systemData'), 'hostpoolUpdate'), parameters('systemData').sessionHostConfigurationVersion, '')]"
},
"systemData": {
"value": "[parameters('systemData')]"
},
"securityType": {
"value": "[parameters('securityType')]"
},
"secureBoot": {
"value": "[parameters('secureBoot')]"
},
"vTPM": {
"value": "[parameters('vTPM')]"
}
}
}
}
],
"outputs": {
"rdshVmNamesObject": {
"value": "[variables('rdshVmNamesOutput')]",
"type": "object"
}
}
}