Skip to content

Commit 5e1af7b

Browse files
committed
retrieved deppref and environment from rg name
1 parent 203453b commit 5e1af7b

File tree

1 file changed

+5
-51
lines changed

1 file changed

+5
-51
lines changed

workload/portal-ui/brownfield/portalUiNewSessionHosts.json

+5-51
Original file line numberDiff line numberDiff line change
@@ -79,52 +79,7 @@
7979
"list": "value|[*].{label:name, value:id}"
8080
}
8181
}
82-
},
83-
{
84-
"name": "deployment",
85-
"type": "Microsoft.Common.Section",
86-
"label": "Deployment Details",
87-
"elements": [
88-
{
89-
"name": "prefix",
90-
"type": "Microsoft.Common.TextBox",
91-
"label": "Deployment Prefix",
92-
"subLabel": "",
93-
"defaultValue": "AVD1",
94-
"toolTip": "The name of the resource group to deploy. (Default: AVD1)",
95-
"constraints": {
96-
"required": true,
97-
"regex": "^[a-zA-Z0-9]{2,4}$",
98-
"validationMessage": "The prefix can be 2-4 aphanumeric characters."
99-
}
100-
},
101-
{
102-
"name": "environment",
103-
"type": "Microsoft.Common.DropDown",
104-
"label": "Deployment Environment",
105-
"defaultValue": "Dev",
106-
"toolTip": "The name of the resource group to deploy.",
107-
"constraints": {
108-
"required": true,
109-
"allowedValues": [
110-
{
111-
"label": "Dev",
112-
"value": "Dev"
113-
},
114-
{
115-
"label": "Test",
116-
"value": "Test"
117-
},
118-
{
119-
"label": "Prod",
120-
"value": "Prod"
121-
}
122-
]
123-
}
124-
}
125-
],
126-
"visible": true
127-
}
82+
}
12883
]
12984
},
13085
{
@@ -148,14 +103,13 @@
148103
{
149104
"name": "customNaming",
150105
"type": "Microsoft.Common.CheckBox",
151-
"label": "Use Custom Session Host Name",
152-
"toolTip": "",
153-
"defaultValue": true
106+
"label": "Use Custom Session Host Name"
154107
},
155108
{
156109
"name": "vmNamePrefix",
157110
"type": "Microsoft.Common.TextBox",
158111
"label": "Session Host Name Prefix",
112+
"defaultValue": "[concat('vm', first(skip(split(steps('basics').resourceGroup.name, '-'), 2)), first(skip(split(steps('basics').resourceGroup.name, '-'), 3)))]",
159113
"toolTip": "Session host prefix",
160114
"constraints": {
161115
"required": true,
@@ -1028,8 +982,8 @@
1028982
"hostPoolResourceId": "[steps('basics').hostPool.id]",
1029983
"location": "[steps('basics').resourceScope.location.name]",
1030984
"computeRgResourceGroupName": "[steps('basics').resourceGroup.name]",
1031-
"deploymentPrefix": "[steps('basics').deployment.prefix]",
1032-
"deploymentEnvironment": "[steps('basics').deployment.environment]",
985+
"deploymentPrefix": "[first(skip(split(steps('basics').resourceGroup.name, '-'), 2))]",
986+
"deploymentEnvironment": "[first(skip(split(steps('basics').resourceGroup.name, '-'), 3))]",
1033987
"customNaming": "[steps('sessionHosts').naming.customNaming]",
1034988
"sessionHostCustomNamePrefix": "[if(steps('sessionHosts').naming.customNaming, steps('sessionHosts').naming.vmNamePrefix, 'notapp')]",
1035989
"count": "[steps('sessionHosts').naming.count]",

0 commit comments

Comments
 (0)