-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsolution.json
7152 lines (7152 loc) · 317 KB
/
solution.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
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.16.1.55165",
"templateHash": "1575551481930079179"
}
},
"parameters": {
"_artifactsLocation": {
"type": "string",
"defaultValue": "https://raw.githubusercontent.com/jamasten/Azure/master/solutions/avd/artifacts/",
"metadata": {
"description": "The URL prefix for linked resources."
}
},
"_artifactsLocationSasToken": {
"type": "securestring",
"defaultValue": "",
"metadata": {
"description": "The SAS Token for the scripts if they are stored on an Azure Storage Account."
}
},
"Availability": {
"type": "string",
"defaultValue": "None",
"metadata": {
"description": "Set the desired availability / SLA with a pooled host pool. Choose \"None\" if deploying a personal host pool."
},
"allowedValues": [
"AvailabilitySet",
"AvailabilityZones",
"None"
]
},
"AvdObjectId": {
"type": "string",
"metadata": {
"description": "The Object ID for the Windows Virtual Desktop Enterprise Application in Azure AD. The Object ID can found by selecting Microsoft Applications using the Application type filter in the Enterprise Applications blade of Azure AD."
}
},
"CustomRdpProperty": {
"type": "string",
"defaultValue": "audiocapturemode:i:1;camerastoredirect:s:*;use multimon:i:0;drivestoredirect:s:;",
"metadata": {
"description": "Input RDP properties to add or remove RDP functionality on the AVD host pool. Settings reference: https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/rdp-files?context=/azure/virtual-desktop/context/context"
}
},
"DiskEncryption": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Enable BitLocker encrytion on the AVD session hosts and management VM."
}
},
"DiskSku": {
"type": "string",
"defaultValue": "Standard_LRS",
"metadata": {
"description": "The storage SKU for the AVD session host disks. Production deployments should use Premium_LRS."
},
"allowedValues": [
"Standard_LRS",
"StandardSSD_LRS",
"Premium_LRS"
]
},
"DisaStigCompliance": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Deploys an Automation Account and uses State Configuration to deploy and monitor DSC compliance. PowerSTIG is used for the STIG configurations that adhere to DISAs STIG compliance."
}
},
"DomainJoinPassword": {
"type": "securestring",
"metadata": {
"description": "The password of the privileged account to domain join the AVD session hosts to your domain"
}
},
"DomainJoinUserPrincipalName": {
"type": "string",
"metadata": {
"description": "The UPN of the privileged account to domain join the AVD session hosts to your domain. This should be an account the resides within the domain you are joining."
}
},
"DomainName": {
"type": "string",
"defaultValue": "jasonmasten.com",
"metadata": {
"description": "The name of the domain that provides ADDS to the AVD session hosts and is synchronized with Azure AD"
}
},
"DomainServices": {
"type": "string",
"defaultValue": "AzureActiveDirectory",
"metadata": {
"description": "The service providing domain services for Azure Virtual Desktop. This is needed to determine the proper solution to domain join the Azure Storage Account."
},
"allowedValues": [
"ActiveDirectory",
"AzureActiveDirectory",
"None",
"NoneWithIntune"
]
},
"DrainMode": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Enable drain mode on sessions hosts during deployment to prevent users from accessing the session hosts."
}
},
"Environment": {
"type": "string",
"defaultValue": "d",
"metadata": {
"description": "The target environment for the solution."
},
"allowedValues": [
"d",
"p",
"s",
"t"
]
},
"EphemeralOsDisk": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Choose whether the session host uses an ephemeral disk for the operating system. Be sure to select a VM SKU that offers a temporary disk that meets your image requirements. Reference: https://docs.microsoft.com/en-us/azure/virtual-machines/ephemeral-os-disks"
}
},
"FslogixShareSizeInGB": {
"type": "int",
"metadata": {
"description": "The file share size(s) in GB for the Fslogix storage solution."
}
},
"FslogixSolution": {
"type": "string",
"defaultValue": "ProfileContainer",
"allowedValues": [
"CloudCacheProfileContainer",
"CloudCacheProfileOfficeContainer",
"ProfileContainer",
"ProfileOfficeContainer"
]
},
"FslogixStorage": {
"type": "string",
"defaultValue": "AzureStorageAccount Standard PublicEndpoint",
"metadata": {
"description": "Enable an Fslogix storage option to manage user profiles for the AVD session hosts. The selected service & SKU should provide sufficient IOPS for all of your users. https://docs.microsoft.com/en-us/azure/architecture/example-scenario/wvd/windows-virtual-desktop-fslogix#performance-requirements"
},
"allowedValues": [
"AzureNetAppFiles Premium",
"AzureNetAppFiles Standard",
"AzureNetAppFiles Ultra",
"AzureStorageAccount Premium PublicEndpoint",
"AzureStorageAccount Premium PrivateEndpoint",
"AzureStorageAccount Premium ServiceEndpoint",
"AzureStorageAccount Standard PublicEndpoint",
"AzureStorageAccount Standard PrivateEndpoint",
"AzureStorageAccount Standard ServiceEndpoint",
"None"
]
},
"HostPoolType": {
"type": "string",
"defaultValue": "Pooled DepthFirst",
"metadata": {
"description": "These options specify the host pool type and depending on the type provides the load balancing options and assignment types."
},
"allowedValues": [
"Pooled DepthFirst",
"Pooled BreadthFirst",
"Personal Automatic",
"Personal Direct"
]
},
"HybridUseBenefit": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Choose whether to enable the Hybrid Use Benefit on the DNS forwarder to support Private Endpoints. Leave the default value if you are not deploying an Azure Storage Account with a Private Endpoint."
}
},
"Identifier": {
"type": "string",
"defaultValue": "avd",
"metadata": {
"description": "The unique identifier between each business unit or project supporting AVD in your tenant. This is the unique naming component between each AVD stamp."
},
"maxLength": 3
},
"ImageOffer": {
"type": "string",
"defaultValue": "office-365",
"metadata": {
"description": "Offer for the virtual machine image"
}
},
"ImagePublisher": {
"type": "string",
"defaultValue": "MicrosoftWindowsDesktop",
"metadata": {
"description": "Publisher for the virtual machine image"
}
},
"ImageSku": {
"type": "string",
"defaultValue": "21h1-evd-o365pp",
"metadata": {
"description": "SKU for the virtual machine image"
}
},
"ImageVersion": {
"type": "string",
"defaultValue": "latest",
"metadata": {
"description": "Version for the virtual machine image"
}
},
"KerberosEncryption": {
"type": "string",
"defaultValue": "RC4",
"metadata": {
"description": "The Active Directory computer object Kerberos encryption type for the Azure Storage Account or Azure NetApp Files Account."
},
"allowedValues": [
"AES256",
"RC4"
]
},
"Location": {
"type": "string",
"defaultValue": "[deployment().location]"
},
"LogAnalyticsWorkspaceRetention": {
"type": "int",
"defaultValue": 30,
"metadata": {
"description": "The retention for the Log Analytics Workspace to setup the AVD Monitoring solution"
},
"minValue": 30,
"maxValue": 730
},
"LogAnalyticsWorkspaceSku": {
"type": "string",
"defaultValue": "PerGB2018",
"metadata": {
"description": "The SKU for the Log Analytics Workspace to setup the AVD Monitoring solution"
},
"allowedValues": [
"Free",
"Standard",
"Premium",
"PerNode",
"PerGB2018",
"Standalone",
"CapacityReservation"
]
},
"MaxSessionLimit": {
"type": "int",
"defaultValue": 2,
"metadata": {
"description": "The maximum number of sessions per AVD session host."
}
},
"Monitoring": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Deploys the required monitoring resources to enable AVD Insights."
}
},
"OuPath": {
"type": "string",
"metadata": {
"description": "The distinguished name for the target Organization Unit in Active Directory Domain Services."
}
},
"RdpShortPath": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Enables the RDP Short Path feature: https://docs.microsoft.com/en-us/azure/virtual-desktop/shortpath"
}
},
"RecoveryServices": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Enable backups to an Azure Recovery Services vault. For a pooled host pool this will enable backups on the Azure file share. For a personal host pool this will enable backups on the AVD sessions hosts."
}
},
"ScalingBeginPeakTime": {
"type": "string",
"defaultValue": "9:00",
"metadata": {
"description": "Time when session hosts will scale up and continue to stay on to support peak demand; Format 24 hours e.g. 9:00 for 9am"
}
},
"ScalingEndPeakTime": {
"type": "string",
"defaultValue": "17:00",
"metadata": {
"description": "Time when session hosts will scale down and stay off to support low demand; Format 24 hours e.g. 17:00 for 5pm"
}
},
"ScalingLimitSecondsToForceLogOffUser": {
"type": "string",
"defaultValue": "0",
"metadata": {
"description": "The number of seconds to wait before automatically signing out users. If set to 0 any session host that has user sessions will be left untouched"
}
},
"ScalingMinimumNumberOfRdsh": {
"type": "string",
"defaultValue": "0",
"metadata": {
"description": "The minimum number of session host VMs to keep running during off-peak hours. The scaling tool will not work if all virtual machines are turned off and the Start VM On Connect solution is not enabled."
}
},
"ScalingSessionThresholdPerCPU": {
"type": "string",
"defaultValue": "1",
"metadata": {
"description": "The maximum number of sessions per CPU that will be used as a threshold to determine when new session host VMs need to be started during peak hours"
}
},
"ScalingTool": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Deploys the required resources for the Scaling Tool. https://docs.microsoft.com/en-us/azure/virtual-desktop/scaling-automation-logic-apps"
}
},
"ScalingTimeDifference": {
"type": "string",
"defaultValue": "-5:00",
"metadata": {
"description": "Time zone off set for host pool location; Format 24 hours e.g. -4:00 for Eastern Daylight Time"
}
},
"ScreenCaptureProtection": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Determines whether the Screen Capture Protection feature is enabled. As of 9/17/21 this is only supported in Azure Cloud. https://docs.microsoft.com/en-us/azure/virtual-desktop/screen-capture-protection"
}
},
"SecurityPrincipalObjectIds": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "An array of Object IDs for the Security Principals to assign to the AVD Application Group and FSLogix Storage."
}
},
"SecurityPrincipalNames": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The name for the Security Principal to assign NTFS permissions on the Azure File Share to support Fslogix. Any value can be input in this field if performing a deployment update or choosing a personal host pool."
}
},
"SentinelLogAnalyticsWorkspaceName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The name of the log analytics workspace used for Azure Sentinel."
}
},
"SentinelLogAnalyticsWorkspaceResourceGroupName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The name of the resource group containing the log analytics workspace used for Azure Sentinel."
}
},
"SentinelLogAnalyticsWorkspaceSubscriptionId": {
"type": "string",
"defaultValue": "[subscription().subscriptionId]",
"metadata": {
"description": "The ID of the subscription containing the log analytics workspace used for Azure Sentinel."
}
},
"SessionHostCount": {
"type": "int",
"defaultValue": 2,
"metadata": {
"description": "The number of session hosts to deploy in the host pool. The default values will allow you deploy 250 VMs using 4 nested deployments. These integers may be modified to create a smaller deployment in a shard."
}
},
"SessionHostIndex": {
"type": "int",
"defaultValue": 0,
"metadata": {
"description": "The session host number to begin with for the deployment. This is important when adding virtual machines to ensure the names do not conflict."
}
},
"StampIndex": {
"type": "int",
"defaultValue": 0,
"metadata": {
"description": "The stamp index specifies the AVD stamp within an Azure environment."
}
},
"StartVmOnConnect": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Determines whether the Start VM On Connect feature is enabled. https://docs.microsoft.com/en-us/azure/virtual-desktop/start-virtual-machine-connect"
}
},
"StorageCount": {
"type": "int",
"defaultValue": 1,
"metadata": {
"description": "The Storage Count allows the deployment of one or more storage resources within an AVD stamp to shard for extra capacity. https://docs.microsoft.com/en-us/azure/architecture/patterns/sharding"
}
},
"StorageIndex": {
"type": "int",
"defaultValue": 0,
"metadata": {
"description": "The Storage Index allows the deployment of one or more storage resources within an AVD stamp to shard for extra capacity. https://docs.microsoft.com/en-us/azure/architecture/patterns/sharding"
}
},
"Subnet": {
"type": "string",
"defaultValue": "Clients",
"metadata": {
"description": "The subnet for the AVD session hosts."
}
},
"Tags": {
"type": "object",
"defaultValue": {
"Owner": "Jason Masten",
"Purpose": "POC",
"Environment": "Development"
},
"metadata": {
"description": "Key / value pairs of metadata for the Azure resources."
}
},
"Timestamp": {
"type": "string",
"defaultValue": "[utcNow('yyyyMMddhhmmss')]",
"metadata": {
"description": "DO NOT MODIFY THIS VALUE! The timestamp is needed to differentiate deployments for certain Azure resources and must be set using a parameter."
}
},
"ValidationEnvironment": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "The value determines whether the hostpool should receive early AVD updates for testing."
}
},
"VirtualNetwork": {
"type": "string",
"metadata": {
"description": "Virtual network for the AVD sessions hosts"
}
},
"VirtualNetworkResourceGroup": {
"type": "string",
"metadata": {
"description": "Virtual network resource group for the AVD sessions hosts"
}
},
"VmPassword": {
"type": "securestring",
"metadata": {
"description": "Local administrator password for the AVD session hosts"
}
},
"VmSize": {
"type": "string",
"defaultValue": "Standard_D4s_v4",
"metadata": {
"description": "The VM SKU for the AVD session hosts."
}
},
"VmUsername": {
"type": "string",
"metadata": {
"description": "The Local Administrator Username for the Session Hosts"
}
}
},
"variables": {
"MaxResourcesPerTemplateDeployment": 79,
"DivisionValue": "[div(parameters('SessionHostCount'), variables('MaxResourcesPerTemplateDeployment'))]",
"DivisionRemainderValue": "[mod(parameters('SessionHostCount'), variables('MaxResourcesPerTemplateDeployment'))]",
"SessionHostBatchCount": "[if(greater(variables('DivisionRemainderValue'), 0), add(variables('DivisionValue'), 1), variables('DivisionValue'))]",
"MaxAvSetMembers": 200,
"BeginAvSetRange": "[div(parameters('SessionHostIndex'), variables('MaxAvSetMembers'))]",
"EndAvSetRange": "[div(add(parameters('SessionHostCount'), parameters('SessionHostIndex')), variables('MaxAvSetMembers'))]",
"AvailabilitySetCount": "[length(range(variables('BeginAvSetRange'), add(sub(variables('EndAvSetRange'), variables('BeginAvSetRange')), 1)))]",
"AppGroupName": "[format('dag-{0}', variables('NamingStandard'))]",
"AvailabilitySetPrefix": "[format('as-{0}', variables('NamingStandard'))]",
"AutomationAccountName": "[format('aa-{0}', variables('NamingStandard'))]",
"ConfigurationName": "Windows10",
"DiskName": "[format('disk-{0}', variables('NamingStandard'))]",
"FileShareNames": {
"CloudCacheProfileContainer": [
"profilecontainers"
],
"CloudCacheProfileOfficeContainer": [
"officecontainers",
"profilecontainers"
],
"ProfileContainer": [
"profilecontainers"
],
"ProfileOfficeContainer": [
"officecontainers",
"profilecontainers"
]
},
"FileShares": "[variables('FileShareNames')[parameters('FslogixSolution')]]",
"Fslogix": "[if(or(equals(parameters('FslogixStorage'), 'None'), contains(parameters('DomainServices'), 'None')), false(), true())]",
"HostPoolName": "[format('hp-{0}', variables('NamingStandard'))]",
"KeyVaultName": "[format('kv-{0}', variables('NamingStandard'))]",
"LocationShortName": "[variables('LocationShortNames')[parameters('Location')]]",
"LocationShortNames": {
"australiacentral": "ac",
"australiacentral2": "ac2",
"australiaeast": "ae",
"australiasoutheast": "as",
"brazilsouth": "bs2",
"brazilsoutheast": "bs",
"canadacentral": "cc",
"canadaeast": "ce",
"centralindia": "ci",
"centralus": "cu",
"eastasia": "ea",
"eastus": "eu",
"eastus2": "eu2",
"francecentral": "fc",
"francesouth": "fs",
"germanynorth": "gn",
"germanywestcentral": "gwc",
"japaneast": "je",
"japanwest": "jw",
"jioindiacentral": "jic",
"jioindiawest": "jiw",
"koreacentral": "kc",
"koreasouth": "ks",
"northcentralus": "ncu",
"northeurope": "ne",
"norwayeast": "ne2",
"norwaywest": "nw",
"southafricanorth": "san",
"southafricawest": "saw",
"southcentralus": "scu",
"southeastasia": "sa",
"southindia": "si",
"swedencentral": "sc",
"switzerlandnorth": "sn",
"switzerlandwest": "sw",
"uaecentral": "uc",
"uaenorth": "un",
"uksouth": "us",
"ukwest": "uw",
"usdodcentral": "uc",
"usdodeast": "ue",
"usgovarizona": "az",
"usgoviowa": "ia",
"usgovtexas": "tx",
"usgovvirginia": "va",
"westcentralus": "wcu",
"westeurope": "we",
"westindia": "wi",
"westus": "wu",
"westus2": "wu2",
"westus3": "wu3"
},
"LogAnalyticsWorkspaceName": "[format('law-{0}', variables('NamingStandard'))]",
"LogicAppPrefix": "[format('la-{0}', variables('NamingStandard'))]",
"ManagedIdentityName": "[format('uami-{0}', variables('NamingStandard'))]",
"ManagementVmName": "[format('{0}mgt', variables('VmName'))]",
"NamingStandard": "[format('{0}-{1}-{2}-{3}', parameters('Identifier'), parameters('Environment'), variables('LocationShortName'), variables('StampIndexFull'))]",
"NetAppAccountName": "[format('naa-{0}', variables('NamingStandard'))]",
"NetAppCapacityPoolName": "[format('nacp-{0}', variables('NamingStandard'))]",
"Netbios": "[split(parameters('DomainName'), '.')[0]]",
"NetworkSecurityGroupName": "[format('nsg-{0}', variables('NamingStandard'))]",
"PooledHostPool": "[if(equals(split(parameters('HostPoolType'), ' ')[0], 'Pooled'), true(), false())]",
"PrivateDnsZoneName": "[format('privatelink.file.{0}', variables('StorageSuffix'))]",
"PrivateEndpoint": "[if(contains(parameters('FslogixStorage'), 'PrivateEndpoint'), true(), false())]",
"RecoveryServicesVaultName": "[format('rsv-{0}', variables('NamingStandard'))]",
"ResourceGroups": [
"[format('rg-{0}-deployment', variables('NamingStandard'))]",
"[format('rg-{0}-hosts', variables('NamingStandard'))]",
"[format('rg-{0}-management', variables('NamingStandard'))]",
"[format('rg-{0}-storage', variables('NamingStandard'))]"
],
"RoleDefinitionIds": {
"contributor": "b24988ac-6180-42a0-ab88-20f7382dd24c",
"desktopVirtualizationPowerOnContributor": "489581de-a3bd-480d-9518-53dea7416b33",
"desktopVirtualizationSessionHostOperator": "2ad6aaab-ead9-4eaa-8ac5-da422f562408",
"desktopVirtualizationUser": "1d18fff3-a72a-46b5-b4a9-0b38a3cd7e63",
"networkContributor": "4d97b98b-1d4f-4787-a291-c67834d212e7",
"reader": "acdd72a7-3385-48ef-bd42-f606fba81ae7",
"storageFileDataSMBShareContributor": "0c867c2a-1d8c-454a-a3db-ab2ea1bdc8bb",
"virtualMachineUserLogin": "fb879df8-f326-4884-b1cf-06f3ad86be52"
},
"Sentinel": "[if(or(empty(parameters('SentinelLogAnalyticsWorkspaceName')), empty(parameters('SentinelLogAnalyticsWorkspaceResourceGroupName'))), false(), true())]",
"SentinelResourceGroup": "[if(variables('Sentinel'), parameters('SentinelLogAnalyticsWorkspaceResourceGroupName'), variables('ResourceGroups')[2])]",
"StampIndexFull": "[padLeft(parameters('StampIndex'), 2, '0')]",
"StorageAccountPrefix": "[format('st{0}{1}{2}{3}', parameters('Identifier'), parameters('Environment'), variables('LocationShortName'), variables('StampIndexFull'))]",
"StorageSolution": "[split(parameters('FslogixStorage'), ' ')[0]]",
"StorageSku": "[if(equals(parameters('FslogixStorage'), 'None'), 'None', split(parameters('FslogixStorage'), ' ')[1])]",
"StorageSuffix": "[environment().suffixes.storage]",
"TimeZones": {
"australiacentral": "AUS Eastern Standard Time",
"australiacentral2": "AUS Eastern Standard Time",
"australiaeast": "AUS Eastern Standard Time",
"australiasoutheast": "AUS Eastern Standard Time",
"brazilsouth": "E. South America Standard Time",
"brazilsoutheast": "E. South America Standard Time",
"canadacentral": "Eastern Standard Time",
"canadaeast": "Eastern Standard Time",
"centralindia": "India Standard Time",
"centralus": "Central Standard Time",
"chinaeast": "China Standard Time",
"chinaeast2": "China Standard Time",
"chinanorth": "China Standard Time",
"chinanorth2": "China Standard Time",
"eastasia": "China Standard Time",
"eastus": "Eastern Standard Time",
"eastus2": "Eastern Standard Time",
"francecentral": "Central Europe Standard Time",
"francesouth": "Central Europe Standard Time",
"germanynorth": "Central Europe Standard Time",
"germanywestcentral": "Central Europe Standard Time",
"japaneast": "Tokyo Standard Time",
"japanwest": "Tokyo Standard Time",
"jioindiacentral": "India Standard Time",
"jioindiawest": "India Standard Time",
"koreacentral": "Korea Standard Time",
"koreasouth": "Korea Standard Time",
"northcentralus": "Central Standard Time",
"northeurope": "GMT Standard Time",
"norwayeast": "Central Europe Standard Time",
"norwaywest": "Central Europe Standard Time",
"southafricanorth": "South Africa Standard Time",
"southafricawest": "South Africa Standard Time",
"southcentralus": "Central Standard Time",
"southindia": "India Standard Time",
"southeastasia": "Singapore Standard Time",
"swedencentral": "Central Europe Standard Time",
"switzerlandnorth": "Central Europe Standard Time",
"switzerlandwest": "Central Europe Standard Time",
"uaecentral": "Arabian Standard Time",
"uaenorth": "Arabian Standard Time",
"uksouth": "GMT Standard Time",
"ukwest": "GMT Standard Time",
"usdodcentral": "Central Standard Time",
"usdodeast": "Eastern Standard Time",
"usgovarizona": "Mountain Standard Time",
"usgoviowa": "Central Standard Time",
"usgovtexas": "Central Standard Time",
"usgovvirginia": "Eastern Standard Time",
"westcentralus": "Mountain Standard Time",
"westeurope": "Central Europe Standard Time",
"westindia": "India Standard Time",
"westus": "Pacific Standard Time",
"westus2": "Pacific Standard Time",
"westus3": "Mountain Standard Time"
},
"VmName": "[format('vm{0}{1}{2}{3}', parameters('Identifier'), parameters('Environment'), variables('LocationShortName'), variables('StampIndexFull'))]",
"VmTemplate": "[format('{{\"domain\":\"{0}\",\"galleryImageOffer\":\"{1}\",\"galleryImagePublisher\":\"{2}\",\"galleryImageSKU\":\"{3}\",\"imageType\":\"Gallery\",\"imageUri\":null,\"customImageId\":null,\"namePrefix\":\"{4}\",\"osDiskType\":\"{5}\",\"useManagedDisks\":true,\"vmSize\":{{\"id\":\"{6}\",\"cores\":null,\"ram\":null}},\"galleryItemId\":\"{7}.{8}{9}\"}}', parameters('DomainName'), parameters('ImageOffer'), parameters('ImagePublisher'), parameters('ImageSku'), variables('VmName'), parameters('DiskSku'), parameters('VmSize'), parameters('ImagePublisher'), parameters('ImageOffer'), parameters('ImageSku'))]",
"WorkspaceName": "[format('ws-{0}', variables('NamingStandard'))]"
},
"resources": [
{
"copy": {
"name": "resourceGroups",
"count": "[length(range(0, length(variables('ResourceGroups'))))]"
},
"type": "Microsoft.Resources/resourceGroups",
"apiVersion": "2020-10-01",
"name": "[variables('ResourceGroups')[range(0, length(variables('ResourceGroups')))[copyIndex()]]]",
"location": "[parameters('Location')]",
"tags": "[parameters('Tags')]"
},
{
"condition": "[parameters('StartVmOnConnect')]",
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2022-04-01",
"name": "[guid(parameters('AvdObjectId'), variables('RoleDefinitionIds').desktopVirtualizationPowerOnContributor, subscription().id)]",
"properties": {
"roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', variables('RoleDefinitionIds').desktopVirtualizationPowerOnContributor)]",
"principalId": "[parameters('AvdObjectId')]"
}
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
"name": "[format('ManagedIdentity_{0}', parameters('Timestamp'))]",
"location": "[deployment().location]",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
},
"mode": "Incremental",
"parameters": {
"DrainMode": {
"value": "[parameters('DrainMode')]"
},
"FslogixStorage": {
"value": "[parameters('FslogixStorage')]"
},
"Location": {
"value": "[parameters('Location')]"
},
"ManagedIdentityName": {
"value": "[variables('ManagedIdentityName')]"
},
"ResourceGroups": {
"value": "[variables('ResourceGroups')]"
},
"RoleDefinitionIds": {
"value": "[variables('RoleDefinitionIds')]"
},
"Timestamp": {
"value": "[parameters('Timestamp')]"
},
"VirtualNetworkResourceGroup": {
"value": "[parameters('VirtualNetworkResourceGroup')]"
}
},
"template": {
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.16.1.55165",
"templateHash": "7663178300611464804"
}
},
"parameters": {
"DrainMode": {
"type": "bool"
},
"FslogixStorage": {
"type": "string"
},
"Location": {
"type": "string"
},
"ManagedIdentityName": {
"type": "string"
},
"ResourceGroups": {
"type": "array"
},
"RoleDefinitionIds": {
"type": "object"
},
"Timestamp": {
"type": "string"
},
"VirtualNetworkResourceGroup": {
"type": "string"
}
},
"variables": {
"RoleAssignments": [
{
"condition": "[parameters('DrainMode')]",
"resourceGroup": "[parameters('ResourceGroups')[2]]",
"roleDefinitionId": "[parameters('RoleDefinitionIds').desktopVirtualizationSessionHostOperator]"
},
{
"condition": "[contains(parameters('FslogixStorage'), 'PrivateEndpoint')]",
"resourceGroup": "[parameters('VirtualNetworkResourceGroup')]",
"roleDefinitionId": "[parameters('RoleDefinitionIds').networkContributor]"
}
]
},
"resources": [
{
"type": "Microsoft.Authorization/roleDefinitions",
"apiVersion": "2018-01-01-preview",
"name": "[guid('DeploymentScriptContributor', subscription().id)]",
"properties": {
"assignableScopes": [
"[subscription().id]"
],
"roleName": "[format('DeploymentScriptContributor_{0}', subscription().subscriptionId)]",
"description": "Allow Deployment Scripts to deploy required resources to run scripts.",
"type": "customRole",
"permissions": [
{
"actions": [
"Microsoft.Storage/storageAccounts/*",
"Microsoft.ContainerInstance/containerGroups/*",
"Microsoft.Resources/deployments/*",
"Microsoft.Resources/deploymentScripts/*",
"Microsoft.ManagedIdentity/userAssignedIdentities/assign/action"
],
"notActions": []
}
]
}
},
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2022-04-01",
"name": "[guid(parameters('ManagedIdentityName'), parameters('RoleDefinitionIds').reader, subscription().id)]",
"properties": {
"roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('RoleDefinitionIds').reader)]",
"principalId": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroups')[0]), 'Microsoft.Resources/deployments', format('UserAssignedManagedIdentity_{0}', parameters('Timestamp'))), '2022-09-01').outputs.principalId.value]",
"principalType": "ServicePrincipal"
},
"dependsOn": [
"[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroups')[0]), 'Microsoft.Resources/deployments', format('UserAssignedManagedIdentity_{0}', parameters('Timestamp')))]"
]
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
"name": "[format('UserAssignedManagedIdentity_{0}', parameters('Timestamp'))]",
"resourceGroup": "[parameters('ResourceGroups')[0]]",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
},
"mode": "Incremental",
"parameters": {
"Location": {
"value": "[parameters('Location')]"
},
"ManagedIdentityName": {
"value": "[parameters('ManagedIdentityName')]"
},
"RoleDefinitionId": {
"value": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', guid('DeploymentScriptContributor', subscription().id))]"
}
},
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.16.1.55165",
"templateHash": "15450050784663186144"
}
},
"parameters": {
"Location": {
"type": "string"
},
"ManagedIdentityName": {
"type": "string"
},
"RoleDefinitionId": {
"type": "string"
}
},
"resources": [
{
"type": "Microsoft.ManagedIdentity/userAssignedIdentities",
"apiVersion": "2018-11-30",
"name": "[parameters('ManagedIdentityName')]",
"location": "[parameters('Location')]"
},
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2022-04-01",
"name": "[guid(parameters('ManagedIdentityName'), parameters('RoleDefinitionId'), resourceGroup().id)]",
"properties": {
"roleDefinitionId": "[parameters('RoleDefinitionId')]",
"principalId": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('ManagedIdentityName')), '2018-11-30').principalId]",
"principalType": "ServicePrincipal"
},
"dependsOn": [
"[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('ManagedIdentityName'))]"
]
}
],
"outputs": {
"principalId": {
"type": "string",
"value": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('ManagedIdentityName')), '2018-11-30').principalId]"
},
"resourceIdentifier": {
"type": "string",
"value": "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('ManagedIdentityName'))]"
}
}
}
},
"dependsOn": [
"[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', guid('DeploymentScriptContributor', subscription().id))]"
]
},
{
"copy": {
"name": "roleAssignments",
"count": "[length(range(0, length(variables('RoleAssignments'))))]"
},
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
"name": "[format('RoleAssignments_{0}_{1}', variables('RoleAssignments')[range(0, length(variables('RoleAssignments')))[copyIndex()]].resourceGroup, parameters('Timestamp'))]",
"resourceGroup": "[variables('RoleAssignments')[range(0, length(variables('RoleAssignments')))[copyIndex()]].resourceGroup]",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
},
"mode": "Incremental",
"parameters": {
"Condition": {
"value": "[variables('RoleAssignments')[range(0, length(variables('RoleAssignments')))[copyIndex()]].condition]"
},
"PrincipalId": {
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroups')[0]), 'Microsoft.Resources/deployments', format('UserAssignedManagedIdentity_{0}', parameters('Timestamp'))), '2022-09-01').outputs.principalId.value]"
},
"RoleDefinitionId": {
"value": "[variables('RoleAssignments')[range(0, length(variables('RoleAssignments')))[copyIndex()]].roleDefinitionId]"
}
},
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.16.1.55165",
"templateHash": "10743090536132938377"
}
},
"parameters": {
"Condition": {
"type": "bool"
},
"PrincipalId": {
"type": "string"
},
"RoleDefinitionId": {
"type": "string"
}
},
"resources": [
{
"condition": "[parameters('Condition')]",
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2022-04-01",
"name": "[guid(parameters('PrincipalId'), parameters('RoleDefinitionId'), resourceGroup().id)]",
"properties": {
"roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('RoleDefinitionId'))]",
"principalId": "[parameters('PrincipalId')]",
"principalType": "ServicePrincipal"
}
}
]
}
},
"dependsOn": [
"[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroups')[0]), 'Microsoft.Resources/deployments', format('UserAssignedManagedIdentity_{0}', parameters('Timestamp')))]"
]
}
],
"outputs": {
"principalId": {
"type": "string",
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroups')[0]), 'Microsoft.Resources/deployments', format('UserAssignedManagedIdentity_{0}', parameters('Timestamp'))), '2022-09-01').outputs.principalId.value]"
},
"resourceIdentifier": {
"type": "string",
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, parameters('ResourceGroups')[0]), 'Microsoft.Resources/deployments', format('UserAssignedManagedIdentity_{0}', parameters('Timestamp'))), '2022-09-01').outputs.resourceIdentifier.value]"
}
}
}
},
"dependsOn": [
"resourceGroups"
]
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
"name": "[format('Validation_{0}', parameters('Timestamp'))]",
"resourceGroup": "[variables('ResourceGroups')[0]]",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
},
"mode": "Incremental",