Skip to content

Commit a4d1649

Browse files
authored
Reduced possible typo's by using Out-Gridviews
Change the section "5. Run the following PowerShell script to create the Azure Logic app and execution schedule." Added more automation and added Gridviews instead of manual input from the user This should reduce errors
1 parent 1e2cf12 commit a4d1649

File tree

1 file changed

+21
-25
lines changed

1 file changed

+21
-25
lines changed

articles/virtual-desktop/virtual-desktop-fall-2019/set-up-scaling-script.md

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -168,42 +168,38 @@ Finally, you'll need to create the Azure Logic App and set up an execution sched
168168
5. Run the following PowerShell script to create the Azure Logic app and execution schedule.
169169
170170
```powershell
171-
$resourceGroupName = Read-Host -Prompt "Enter the name of the resource group for the new Azure Logic App"
171+
$aadTenantId = (Get-AzContext).Tenant.Id
172+
173+
$azureSubscription = Get-AzSubscription | Out-GridView -PassThru -Title "Select your Azure Subscription"
174+
Select-AzSubscription -Subscription $azureSubscription.Id
175+
$subscriptionId = $azureSubscription.Id
176+
177+
$resourceGroup = Get-AzResourceGroup | Out-GridView -PassThru -Title "Select the resource group for the new Azure Logic App"
178+
$resourceGroupName = $resourceGroup.ResourceGroupName
179+
$location = $resourceGroup.Location
180+
181+
$wvdTenant = Get-RdsTenant | Out-GridView -PassThru -Title "Select your WVD tenant"
182+
$tenantName = $wvdTenant.TenantName
183+
184+
$wvdHostpool = Get-RdsHostPool -TenantName $wvdTenant.TenantName | Out-GridView -PassThru -Title "Select the host pool you'd like to scale"
185+
$hostPoolName = $wvdHostpool.HostPoolName
172186
173-
$aadTenantId = Read-Host -Prompt "Enter your Azure AD tenant ID"
174-
175-
$subscriptionId = Read-Host -Prompt "Enter your Azure Subscription ID"
176-
177-
$tenantName = Read-Host -Prompt "Enter the name of your WVD tenant"
178-
179-
$hostPoolName = Read-Host -Prompt "Enter the name of the host pool you'd like to scale"
180-
181187
$recurrenceInterval = Read-Host -Prompt "Enter how often you'd like the job to run in minutes, e.g. '15'"
182-
183188
$beginPeakTime = Read-Host -Prompt "Enter the start time for peak hours in local time, e.g. 9:00"
184-
185189
$endPeakTime = Read-Host -Prompt "Enter the end time for peak hours in local time, e.g. 18:00"
186-
187190
$timeDifference = Read-Host -Prompt "Enter the time difference between local time and UTC in hours, e.g. +5:30"
188-
189191
$sessionThresholdPerCPU = Read-Host -Prompt "Enter 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"
190-
191192
$minimumNumberOfRdsh = Read-Host -Prompt "Enter the minimum number of session host VMs to keep running during off-peak hours"
192-
193193
$limitSecondsToForceLogOffUser = Read-Host -Prompt "Enter the number of seconds to wait before automatically signing out users. If set to 0, users will be signed out immediately"
194-
195194
$logOffMessageTitle = Read-Host -Prompt "Enter the title of the message sent to the user before they are forced to sign out"
196-
197195
$logOffMessageBody = Read-Host -Prompt "Enter the body of the message sent to the user before they are forced to sign out"
198-
199-
$location = Read-Host -Prompt "Enter the name of the Azure region where you will be creating the logic app"
200-
201-
$connectionAssetName = Read-Host -Prompt "Enter the name of the Azure RunAs connection asset"
202-
196+
197+
$automationAccount = Get-AzAutomationAccount -ResourceGroupName $resourceGroup.ResourceGroupName | Out-GridView -PassThru
198+
$automationAccountName = $automationAccount.AutomationAccountName
199+
$automationAccountConnection = Get-AzAutomationConnection -ResourceGroupName $resourceGroup.ResourceGroupName -AutomationAccountName $automationAccount.AutomationAccountName | Out-GridView -PassThru -Title "Select the Azure RunAs connection asset"
200+
$connectionAssetName = $automationAccountConnection.Name
201+
203202
$webHookURI = Read-Host -Prompt "Enter the URI of the WebHook returned by when you created the Azure Automation Account"
204-
205-
$automationAccountName = Read-Host -Prompt "Enter the name of the Azure Automation Account"
206-
207203
$maintenanceTagName = Read-Host -Prompt "Enter the name of the Tag associated with VMs you don't want to be managed by this scaling tool"
208204
209205
.\createazurelogicapp.ps1 -ResourceGroupName $resourceGroupName `

0 commit comments

Comments
 (0)