From 1e4365338211595dcfc6e47a3a93b731176221e8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 16 Oct 2025 12:56:03 +0000 Subject: [PATCH 1/2] Initial plan From 8944e1482e3875c10d1bd68912ebbc5a6e156908 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 16 Oct 2025 13:09:42 +0000 Subject: [PATCH 2/2] Add host pool management type selection feature Co-authored-by: danycontre <78437433+danycontre@users.noreply.github.com> --- .../host-pool/main.bicep | 10 +++++- workload/bicep/deploy-baseline.bicep | 8 +++++ .../modules/avdManagementPlane/deploy.bicep | 8 +++++ workload/portal-ui/portal-ui-baseline.json | 35 +++++++++++++++++++ 4 files changed, 60 insertions(+), 1 deletion(-) diff --git a/avm/1.0.0/res/desktop-virtualization/host-pool/main.bicep b/avm/1.0.0/res/desktop-virtualization/host-pool/main.bicep index b71262c51..dce41c800 100644 --- a/avm/1.0.0/res/desktop-virtualization/host-pool/main.bicep +++ b/avm/1.0.0/res/desktop-virtualization/host-pool/main.bicep @@ -110,6 +110,13 @@ param ssoClientSecretKeyVaultPath string = '' #disable-next-line secure-secrets-in-params param ssoSecretType string = '' +@sys.description('Optional. Specifies the type of management for the host pool. Use "Unmanaged" for manual session host management or "AutomaticSessionHostConfiguration" to enable automated session host provisioning (Preview).') +@allowed([ + 'Unmanaged' + 'AutomaticSessionHostConfiguration' +]) +param managedBy string = 'Unmanaged' + @sys.description('Optional. Tags of the resource.') param tags object? @@ -176,7 +183,7 @@ resource avmTelemetry 'Microsoft.Resources/deployments@2025-04-01' = } } -resource hostPool 'Microsoft.DesktopVirtualization/hostPools@2025-03-01-preview' = { +resource hostPool 'Microsoft.DesktopVirtualization/hostPools@2025-04-01-preview' = { name: name location: location tags: tags @@ -184,6 +191,7 @@ resource hostPool 'Microsoft.DesktopVirtualization/hostPools@2025-03-01-preview' friendlyName: friendlyName description: description hostPoolType: hostPoolType + managedBy: managedBy publicNetworkAccess: publicNetworkAccess customRdpProperty: customRdpProperty personalDesktopAssignmentType: any(personalDesktopAssignmentType) diff --git a/workload/bicep/deploy-baseline.bicep b/workload/bicep/deploy-baseline.bicep index 0f705d275..3326dbba5 100644 --- a/workload/bicep/deploy-baseline.bicep +++ b/workload/bicep/deploy-baseline.bicep @@ -126,6 +126,13 @@ param avdHostPoolLoadBalancerType string = 'BreadthFirst' @sys.description('AVD host pool maximum number of user sessions per session host. (Default: 8)') param hostPoolMaxSessions int = 8 +@allowed([ + 'Unmanaged' + 'AutomaticSessionHostConfiguration' +]) +@sys.description('AVD host pool management type. Use "Unmanaged" for manual session host management or "AutomaticSessionHostConfiguration" to enable automated session host provisioning (Preview). (Default: Unmanaged)') +param avdHostPoolManagedBy string = 'Unmanaged' + @sys.description('AVD host pool start VM on Connect. (Default: true)') param avdStartVmOnConnect bool = true @@ -1182,6 +1189,7 @@ module managementPLane './modules/avdManagementPlane/deploy.bicep' = { hostPoolRdpProperties: avdHostPoolRdpProperties hostPoolLoadBalancerType: avdHostPoolLoadBalancerType hostPoolType: avdHostPoolType + hostPoolManagedBy: avdHostPoolManagedBy preferredAppGroupType: (hostPoolPreferredAppGroupType == 'RemoteApp') ? 'RailApplications' : 'Desktop' deployScalingPlan: !empty(avdServicePrincipalObjectId) ? varDeployScalingPlan : false scalingPlanExclusionTag: varScalingPlanExclusionTag diff --git a/workload/bicep/modules/avdManagementPlane/deploy.bicep b/workload/bicep/modules/avdManagementPlane/deploy.bicep index ccbc337c1..0fc56043b 100644 --- a/workload/bicep/modules/avdManagementPlane/deploy.bicep +++ b/workload/bicep/modules/avdManagementPlane/deploy.bicep @@ -120,6 +120,13 @@ param workspacePublicNetworkAccess string = 'Enabled' @sys.description('Optional. AVD host pool type.') param personalAssignType string +@allowed([ + 'Unmanaged' + 'AutomaticSessionHostConfiguration' +]) +@sys.description('Optional. Specifies the type of management for the host pool. Use "Unmanaged" for manual session host management or "AutomaticSessionHostConfiguration" to enable automated session host provisioning (Preview).') +param hostPoolManagedBy string = 'Unmanaged' + @allowed([ 'BreadthFirst' 'DepthFirst' @@ -239,6 +246,7 @@ module hostPool '../../../../avm/1.0.0/res/desktop-virtualization/host-pool/main friendlyName: hostPoolFriendlyName location: managementPlaneLocation hostPoolType: hostPoolType + managedBy: hostPoolManagedBy startVMOnConnect: startVmOnConnect customRdpProperty: varHostPoolRdpPropertiesDomainServiceCheck loadBalancerType: hostPoolLoadBalancerType diff --git a/workload/portal-ui/portal-ui-baseline.json b/workload/portal-ui/portal-ui-baseline.json index 2a9994178..15c0d2e01 100644 --- a/workload/portal-ui/portal-ui-baseline.json +++ b/workload/portal-ui/portal-ui-baseline.json @@ -445,6 +445,40 @@ "uri": "https://docs.microsoft.com/azure/virtual-desktop/environment-setup" } }, + { + "name": "hostPoolManagementType", + "type": "Microsoft.Common.DropDown", + "visible": true, + "label": "Host pool management type", + "defaultValue": "Without Session Host Configuration (Default)", + "multiLine": true, + "toolTip": "Select whether to enable automated session host provisioning. 'With Session Host Configuration' enables automated provisioning (Preview). 'Without Session Host Configuration' requires manual session host registration using a registration key.", + "constraints": { + "required": true, + "allowedValues": [ + { + "label": "Without Session Host Configuration (Default)", + "description": "Manually add session hosts using a registration key", + "value": "Unmanaged" + }, + { + "label": "With Session Host Configuration (Preview)", + "description": "Enables automated session host provisioning", + "value": "AutomaticSessionHostConfiguration" + } + ] + } + }, + { + "name": "hostPoolManagementTypeInfo", + "type": "Microsoft.Common.InfoBox", + "visible": "[equals(steps('managementPlane').managementPlaneHostPoolSettings.hostPoolManagementType, 'AutomaticSessionHostConfiguration')]", + "options": { + "style": "Info", + "text": "Session Host Configuration is currently in Preview. This feature enables automated provisioning and management of session hosts. Learn more about this preview feature.", + "uri": "https://learn.microsoft.com/en-us/azure/virtual-desktop/host-pool-management-approaches" + } + }, { "name": "loadBalancerType", "type": "Microsoft.Common.DropDown", @@ -2768,6 +2802,7 @@ "avdHostPoolLoadBalancerType": "[steps('managementPlane').managementPlaneHostPoolSettings.loadBalancerType]", "hostPoolMaxSessions": "[if(equals(steps('managementPlane').managementPlaneHostPoolSettings.hostPoolType, 'Pooled'), steps('managementPlane').managementPlaneHostPoolSettings.maxSessions, 1)]", "avdPersonalAssignType": "[if(equals(steps('managementPlane').managementPlaneHostPoolSettings.hostPoolType, 'Personal'), steps('managementPlane').managementPlaneHostPoolSettings.assignmentType, 'Automatic')]", + "avdHostPoolManagedBy": "[steps('managementPlane').managementPlaneHostPoolSettings.hostPoolManagementType]", "avdIdentityServiceProvider": "[steps('identity').identityDomainInformation.identityServiceProvider]", "createIntuneEnrollment": "[if(contains(steps('identity').identityDomainInformation.identityServiceProvider, 'EntraID'), steps('identity').identityDomainInformation.identityServiceProviderIntuneEnrollment, false)]", "identityDomainName": "[if(equals(steps('identity').identityDomainInformation.identityServiceProvider, 'EntraID'), '', steps('identity').identityDomainInformation.identityDomainName)]",