Skip to content

Commit a4afbad

Browse files
authored
Merge pull request #783 from Azure/count-index-fix
Adding input restrictions to session host count index
2 parents 545c70f + 5658ae8 commit a4afbad

File tree

5 files changed

+107
-66
lines changed

5 files changed

+107
-66
lines changed

.github/workflows/devskim.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
jobs:
1717
lint:
1818
name: DevSkim
19-
runs-on: ubuntu-20.04
19+
runs-on: Ubuntu 22.04
2020
permissions:
2121
actions: read
2222
contents: read

workload/arm/deploy-baseline.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.34.44.8038",
8-
"templateHash": "2844762627669354029"
8+
"templateHash": "14053498666684800097"
99
},
1010
"name": "AVD Accelerator - Baseline Deployment",
1111
"description": "AVD Accelerator - Deployment Baseline",
@@ -56,7 +56,6 @@
5656
},
5757
"avdWorkloadSubsId": {
5858
"type": "string",
59-
"defaultValue": "",
6059
"metadata": {
6160
"description": "AVD workload subscription ID, multiple subscriptions scenario. (Default: \"\")"
6261
}
@@ -445,16 +444,18 @@
445444
"type": "int",
446445
"defaultValue": 1,
447446
"minValue": 1,
448-
"maxValue": 100,
447+
"maxValue": 1999,
449448
"metadata": {
450449
"description": "Quantity of session hosts to deploy. (Default: 1)"
451450
}
452451
},
453452
"avdSessionHostCountIndex": {
454453
"type": "int",
455454
"defaultValue": 1,
455+
"minValue": 1,
456+
"maxValue": 9998,
456457
"metadata": {
457-
"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. (Default: 1)"
458+
"description": "The session host number to begin with for the deployment. This is important when adding virtual machines to host pool ensure the names do not conflict. (Default: 1)"
458459
}
459460
},
460461
"availability": {

workload/bicep/deploy-baseline.bicep

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ param avdSessionHostLocation string
3333
param avdManagementPlaneLocation string
3434

3535
@sys.description('AVD workload subscription ID, multiple subscriptions scenario. (Default: "")')
36-
param avdWorkloadSubsId string = ''
36+
param avdWorkloadSubsId string
3737

3838
@sys.description('Azure Virtual Desktop Enterprise Application object ID (Enterprise app name: Azure Virtual Desktop) . (Default: "")')
3939
param avdServicePrincipalObjectId string = ''
@@ -220,11 +220,13 @@ param avdAlaWorkspaceDataRetention int = 90
220220
param alaExistingWorkspaceResourceId string = ''
221221

222222
@minValue(1)
223-
@maxValue(100)
223+
@maxValue(1999)
224224
@sys.description('Quantity of session hosts to deploy. (Default: 1)')
225225
param avdDeploySessionHostsCount int = 1
226226

227-
@sys.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. (Default: 1)')
227+
@minValue(1)
228+
@maxValue(9998)
229+
@sys.description('The session host number to begin with for the deployment. This is important when adding virtual machines to host pool ensure the names do not conflict. (Default: 1)')
228230
param avdSessionHostCountIndex int = 1
229231

230232
@sys.description('When true VMs are distributed across availability zones, when set to false, VMs will be deployed at regional level.')

workload/bicep/readme.md

Lines changed: 94 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -8,78 +8,116 @@ A full list of parameter details can be found for the relevant deployment type h
88
- [Deploy AVD Baseline](../docs/autoGenerated/deploy-baseline.bicep.md)
99
- [Deploy AVD Custom Image Baseline](../docs/autoGenerated/deploy-custom-image.bicep.md)
1010

11-
### Azure CLI
12-
13-
```bash
14-
az deployment create \
15-
--template-file workload/bicep/deploy-baseline.bicep \
16-
--parameters avdWorkloadSubsId=<subscriptionId> \
17-
--parameters deploymentPrefix=<deploymentPrefix> \
18-
--parameters avdVmLocalUserName=<localUserName> \
19-
--parameters avdVmLocalUserPassword=<LocalUserPassword> \
20-
--parameters avdIdentityServiceProvider="<IdentityServiceProvider>" \
21-
--parameters avdIdentityDomainName=<DomainJoinUserName> \
22-
--parameters avdDomainJoinUserName=<domainName> \
23-
--parameters avdDomainJoinUserPassword=<DomainJoinUserPassword \
24-
--parameters existingHubVnetResourceId=<hubVnetResourceId> \
25-
--parameters customDnsIps=<customDNSservers> \
26-
--parameters avdServicePrincipalObjectId=<wvdAppObjectId> \
27-
--parameters avdVnetPrivateDnsZone=true \
28-
--parameters avdVnetPrivateDnsZoneFilesId="<PrivateDnsZoneFilesId>" \
29-
--parameters avdVnetPrivateDnsZoneKeyvaultId="<PrivateDnsZoneKeyvaultId>" \
30-
--avdDeployMonitoring=true \
31-
--deployAlaWorkspace=true \
32-
--location "eastus"
33-
```
34-
3511
### PowerShell
3612

3713
```powershell
14+
Connect-AzAccount
15+
#
16+
$SubID = "<subscription-ID>"
3817
$avdVmLocalUserPassword = Read-Host -Prompt "Local user password" -AsSecureString
39-
$avdDomainJoinUserPassword = Read-Host -Prompt "Domain join password" -AsSecureString
18+
#
19+
Select-AzSubscription -SubscriptionId $SubID
4020
New-AzSubscriptionDeployment `
41-
-TemplateFile workload/bicep/deploy-baseline.bicep `
42-
-avdWorkloadSubsId "<subscriptionId>" `
43-
-deploymentPrefix "<deploymentPrefix>" `
44-
-avdVmLocalUserName "<localUserName>" `
21+
-Name "AVDAcceleratorDeployment" `
22+
-Location "<deployment-location>" `
23+
-TemplateFile "./workload/bicep/deploy-baseline.bicep" `
24+
-avdWorkloadSubsId $SubID `
25+
-avdSessionHostLocation "<session-host-location>" `
26+
-avdManagementPlaneLocation "<management-plane-location>" `
27+
-avdVmLocalUserName "<local-username>" `
4528
-avdVmLocalUserPassword $avdVmLocalUserPassword `
46-
-avdIdentityServiceProvider "<IdentityServiceProvider>" `
47-
-avdIdentityDomainName "<domainJoinUserName>" `
48-
-avdDomainJoinUserName "<domainJoinUserName>" `
49-
-avdDomainJoinUserPassword $avdDomainJoinUserPassword `
50-
-existingHubVnetResourceId "<hubVnetResourceId>" `
51-
-customDnsIps "<customDNSservers>" `
52-
-avdServicePrincipalObjectId "<wvdAppObjectId>" `
53-
-avdVnetPrivateDnsZone $true `
54-
-avdVnetPrivateDnsZoneFilesId "<PrivateDnsZoneFilesId>" `
55-
-avdVnetPrivateDnsZoneKeyvaultId "<PrivateDnsZoneKeyvaultId>" `
56-
-avdDeployMonitoring $true `
57-
-deployAlaWorkspace $true `
58-
-Location "eastus"
29+
-avdIdentityServiceProvider "EntraIDKerberos" `
30+
-identityDomainName "<domain-name>" `
31+
-avdServicePrincipalObjectId "<object-id>" `
32+
-avdSecurityGroups @(@{objectId="00000000-0000-0000-0000-000000000000"; displayName="Example-Security-Group"}) `
33+
-avdVnetworkAddressPrefixes "10.10.0.0/16" `
34+
-vNetworkAvdSubnetAddressPrefix "10.10.1.0/24" `
35+
-vNetworkPrivateEndpointSubnetAddressPrefix "10.10.2.0/27"
5936
```
60-
61-
## Optional: Custom Image Build deployment
37+
> Note: above PowerShell deployment sample, deploys AVD with most of the default options in the AVD LZA using Entra ID Kerberos as identity provider and deploying new virtual network.
6238
6339
### Azure CLI
6440

6541
```bash
66-
az deployment create \
67-
--template-file workload/bicep/deploy-custom-image.bicep \
68-
--parameters sharedServicesSubId="<subscriptionId>" \
69-
--deploymentLocation="eastus" \
70-
--imageVersionPrimaryLocation="eastus" \
71-
--Location "eastus"
42+
az login
43+
#
44+
SubID="<subscription-ID>"
45+
read -s -p "Local user password: " avdVmLocalUserPassword
46+
#
47+
az account set --subscription "$SubID"
48+
az deployment sub create \
49+
--name "AVDAcceleratorDeployment" \
50+
--location "<deployment-location>" \
51+
--template-file "./workload/bicep/deploy-baseline.bicep" \
52+
--parameters \
53+
avdWorkloadSubsId="$SubID" \
54+
avdSessionHostLocation="<session-host-location>" \
55+
avdManagementPlaneLocation="<management-plane-location>" \
56+
avdVmLocalUserName="<local-username>" \
57+
avdVmLocalUserPassword="$avdVmLocalUserPassword" \
58+
avdIdentityServiceProvider="EntraIDKerberos" \
59+
identityDomainName="<domain-name>" \
60+
avdServicePrincipalObjectId="<object-id>" \
61+
avdSecurityGroups="[{\"objectId\": \"00000000-0000-0000-0000-000000000000\", \"displayName\": \"Example-Security-Group\"}]" \
62+
avdVnetworkAddressPrefixes="10.10.0.0/16" \
63+
vNetworkAvdSubnetAddressPrefix="10.10.1.0/24" \
64+
vNetworkPrivateEndpointSubnetAddressPrefix="10.10.2.0/27"
7265
```
66+
> Note: above AZ CLI deployment sample, deploys AVD with most of the default options in the AVD LZA using Entra ID Kerberos as identity provider and deploying new virtual network.
67+
68+
## Optional: Custom Image Build deployment
7369

7470
### PowerShell
7571

7672
```powershell
77-
New-AzSubscriptionDeployment `
78-
-TemplateFile workload/bicep/deploy-custom-image.bicep `
79-
-sharedServicesSubId "<subscriptionId>" `
80-
-deploymentLocation "eastus" `
81-
-imageVersionPrimaryLocation "eastus" `
82-
-Location "eastus"
73+
Connect-AzAccount
74+
#
75+
$SubID = "<subscription-ID>"
76+
#
77+
Select-AzSubscription -SubscriptionId $SubID
78+
New-AzDeployment `
79+
-Location "<deployment-location>" `
80+
-TemplateFile "./workload/bicep/deploy-custom-image.bicep" `
81+
-Name "CustomImageDeployment" `
82+
-SubscriptionId $SubID `
83+
-sharedServicesSubId "<shared-services-subscription-id>" `
84+
-deploymentLocation "<deployment-location>" `
85+
-imageVersionPrimaryLocation "<primary-location>" `
86+
-mpImagePublisher "<image-publisher>" `
87+
-mpImageOffer "<image-offer>" `
88+
-mpImageSku "<image-sku>" `
89+
-mpImageVersion "latest" `
90+
-userAssignedManagedIdentityCustomName "<managed-identity-name>" `
91+
-enableMonitoringAlerts $false `
92+
-enableResourceTags $false `
93+
-enableTelemetry $true
94+
```
95+
96+
### Azure CLI
97+
98+
```bash
99+
az login
100+
#
101+
SubID="<subscription-ID>"
102+
#
103+
az account set --subscription "$SubID"
104+
az deployment sub create \
105+
--name "CustomImageDeployment" \
106+
--location "<deployment-location>" \
107+
--template-file "./workload/bicep/deploy-custom-image.bicep" \
108+
--parameters \
109+
subscriptionId="$SubID" \
110+
sharedServicesSubId="<shared-services-subscription-id>" \
111+
deploymentLocation="<deployment-location>" \
112+
imageVersionPrimaryLocation="<primary-location>" \
113+
mpImagePublisher="<image-publisher>" \
114+
mpImageOffer="<image-offer>" \
115+
mpImageSku="<image-sku>" \
116+
mpImageVersion="latest" \
117+
userAssignedManagedIdentityCustomName="<managed-identity-name>" \
118+
enableMonitoringAlerts=false \
119+
enableResourceTags=false \
120+
enableTelemetry=true
83121
```
84122

85123
## Contributing

workload/portal-ui/portal-ui-baseline.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@
842842
"defaultValue": 1,
843843
"toolTip": "Select the start number of the virtual machine suffix.",
844844
"min": 1,
845-
"max": 4998,
845+
"max": 9998,
846846
"showStepMarkers": true,
847847
"constraints": {
848848
"required": true
@@ -855,7 +855,7 @@
855855
"defaultValue": 1,
856856
"toolTip": "Select the number of virtual machines to deploy in your AVD host pool.",
857857
"min": 1,
858-
"max": 4999,
858+
"max": 1999,
859859
"showStepMarkers": true,
860860
"constraints": {
861861
"required": true

0 commit comments

Comments
 (0)