From 95c7476314df7dcfb1bf7c1f4563ba9ad102481d Mon Sep 17 00:00:00 2001 From: Dany Contreras Date: Mon, 7 Apr 2025 08:46:13 -0500 Subject: [PATCH 1/2] updates --- .../brownfield/portalUiNewSessionHosts.json | 49 ++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/workload/portal-ui/brownfield/portalUiNewSessionHosts.json b/workload/portal-ui/brownfield/portalUiNewSessionHosts.json index 340e56a3e..22ef954f1 100644 --- a/workload/portal-ui/brownfield/portalUiNewSessionHosts.json +++ b/workload/portal-ui/brownfield/portalUiNewSessionHosts.json @@ -79,6 +79,51 @@ "list": "value|[*].{label:name, value:id}" } } + }, + { + "name": "deployment", + "type": "Microsoft.Common.Section", + "label": "Deployment Details", + "elements": [ + { + "name": "prefix", + "type": "Microsoft.Common.TextBox", + "label": "Deployment Prefix", + "subLabel": "", + "defaultValue": "AVD1", + "toolTip": "The name of the resource group to deploy. (Default: AVD1)", + "constraints": { + "required": true, + "regex": "^[a-zA-Z0-9]{2,4}$", + "validationMessage": "The prefix can be 2-4 aphanumeric characters." + } + }, + { + "name": "environment", + "type": "Microsoft.Common.DropDown", + "label": "Deployment Environment", + "defaultValue": "Dev", + "toolTip": "The name of the resource group to deploy.", + "constraints": { + "required": true, + "allowedValues": [ + { + "label": "Dev", + "value": "Dev" + }, + { + "label": "Test", + "value": "Test" + }, + { + "label": "Prod", + "value": "Prod" + } + ] + } + } + ], + "visible": true } ] }, @@ -982,8 +1027,8 @@ "hostPoolResourceId": "[steps('basics').hostPool.id]", "location": "[steps('basics').resourceScope.location.name]", "computeRgResourceGroupName": "[steps('basics').resourceGroup.name]", - "deploymentPrefix": "[first(skip(split(steps('basics').resourceGroup.name, '-'), 2))]", - "deploymentEnvironment": "[first(skip(split(steps('basics').resourceGroup.name, '-'), 3))]", + "deploymentPrefix": "[steps('basics').deployment.prefix]", + "deploymentEnvironment": "[steps('basics').deployment.environment]", "customNaming": "[steps('sessionHosts').naming.customNaming]", "sessionHostCustomNamePrefix": "[if(steps('sessionHosts').naming.customNaming, steps('sessionHosts').naming.vmNamePrefix, 'notapp')]", "count": "[steps('sessionHosts').naming.count]", From b93bac7ebe91a13d000963cfa11393704fb12b16 Mon Sep 17 00:00:00 2001 From: Dany Contreras Date: Mon, 7 Apr 2025 08:51:34 -0500 Subject: [PATCH 2/2] updates --- .../brownfield/portalUiNewSessionHosts.json | 50 ++++++++----------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/workload/portal-ui/brownfield/portalUiNewSessionHosts.json b/workload/portal-ui/brownfield/portalUiNewSessionHosts.json index 22ef954f1..508936bb5 100644 --- a/workload/portal-ui/brownfield/portalUiNewSessionHosts.json +++ b/workload/portal-ui/brownfield/portalUiNewSessionHosts.json @@ -79,15 +79,31 @@ "list": "value|[*].{label:name, value:id}" } } + } + ] + }, + { + "name": "sessionHosts", + "label": "Session Hosts", + "elements": [ + { + "name": "resourceSkusApi", + "type": "Microsoft.Solutions.ArmApiControl", + "condition": "[and(not(empty(steps('basics').resourceScope.subscription)), not(empty(steps('basics').resourceScope.location)))]", + "request": { + "method": "GET", + "path": "[concat(steps('basics').resourceScope.subscription.id, '/providers/Microsoft.Compute/skus?api-version=2021-07-01&$filter=location eq ', decodeUriComponent('%27'), steps('basics').resourceScope.location.name, decodeUriComponent('%27'))]" + } }, { - "name": "deployment", + "name": "naming", "type": "Microsoft.Common.Section", - "label": "Deployment Details", + "label": "Virtual Machine Naming", "elements": [ { "name": "prefix", "type": "Microsoft.Common.TextBox", + "visible": "[not(steps('sessionHosts').naming.customNaming)]", "label": "Deployment Prefix", "subLabel": "", "defaultValue": "AVD1", @@ -102,6 +118,7 @@ "name": "environment", "type": "Microsoft.Common.DropDown", "label": "Deployment Environment", + "visible": "[not(steps('sessionHosts').naming.customNaming)]", "defaultValue": "Dev", "toolTip": "The name of the resource group to deploy.", "constraints": { @@ -121,30 +138,7 @@ } ] } - } - ], - "visible": true - } - ] - }, - { - "name": "sessionHosts", - "label": "Session Hosts", - "elements": [ - { - "name": "resourceSkusApi", - "type": "Microsoft.Solutions.ArmApiControl", - "condition": "[and(not(empty(steps('basics').resourceScope.subscription)), not(empty(steps('basics').resourceScope.location)))]", - "request": { - "method": "GET", - "path": "[concat(steps('basics').resourceScope.subscription.id, '/providers/Microsoft.Compute/skus?api-version=2021-07-01&$filter=location eq ', decodeUriComponent('%27'), steps('basics').resourceScope.location.name, decodeUriComponent('%27'))]" - } - }, - { - "name": "naming", - "type": "Microsoft.Common.Section", - "label": "Virtual Machine Naming", - "elements": [ + }, { "name": "customNaming", "type": "Microsoft.Common.CheckBox", @@ -1027,8 +1021,8 @@ "hostPoolResourceId": "[steps('basics').hostPool.id]", "location": "[steps('basics').resourceScope.location.name]", "computeRgResourceGroupName": "[steps('basics').resourceGroup.name]", - "deploymentPrefix": "[steps('basics').deployment.prefix]", - "deploymentEnvironment": "[steps('basics').deployment.environment]", + "deploymentPrefix": "[if(not(steps('sessionHosts').naming.customNaming), steps('sessionHosts').naming.prefix, '')]", + "deploymentEnvironment": "[if(not(steps('sessionHosts').naming.customNaming), steps('sessionHosts').naming.environment, '')]", "customNaming": "[steps('sessionHosts').naming.customNaming]", "sessionHostCustomNamePrefix": "[if(steps('sessionHosts').naming.customNaming, steps('sessionHosts').naming.vmNamePrefix, 'notapp')]", "count": "[steps('sessionHosts').naming.count]",