Skip to content

Commit b7e7b37

Browse files
committed
Merge branch 'main' into 1068-esri-enterprise-updates
2 parents 6d71c88 + 57cce4d commit b7e7b37

File tree

78 files changed

+8096
-7394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+8096
-7394
lines changed

docs/deployment-guides/command-line-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The following prerequisites are required on the target Azure subscription(s):
3232

3333
### Decide on a Resource Prefix
3434

35-
Resource Groups and resource names are derived from the required parameter `resourcePrefix`. Pick a unqiue resource prefix that is 3-6 alphanumeric characters in length without whitespaces.
35+
Resource Groups and resource names are derived from the required parameter `resourcePrefix`. Pick a unqiue resource prefix that is 1-6 alphanumeric characters in length without whitespaces.
3636

3737
### One Subscription or Multiple
3838

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Param(
2+
[string]$HostPoolResourceId,
3+
[string]$ResourceGroupName,
4+
[string]$ResourceManagerUri,
5+
[string]$ScalingPlanName,
6+
[string]$SubscriptionId,
7+
[string]$UserAssignedIdentityClientId
8+
)
9+
10+
$ErrorActionPreference = 'Stop'
11+
$WarningPreference = 'SilentlyContinue'
12+
13+
# Fix the resource manager URI since only AzureCloud contains a trailing slash
14+
$ResourceManagerUriFixed = if($ResourceManagerUri[-1] -eq '/'){$ResourceManagerUri} else {$ResourceManagerUri + '/'}
15+
16+
# Get an access token for Azure resources
17+
$AzureManagementAccessToken = (Invoke-RestMethod `
18+
-Headers @{Metadata="true"} `
19+
-Uri $('http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=' + $ResourceManagerUriFixed + '&client_id=' + $UserAssignedIdentityClientId)).access_token
20+
21+
# Set header for Azure Management API
22+
$AzureManagementHeader = @{
23+
'Content-Type'='application/json'
24+
'Authorization'='Bearer ' + $AzureManagementAccessToken
25+
}
26+
27+
# Check if the scaling plan exists: https://learn.microsoft.com/rest/api/desktopvirtualization/scaling-plans/list-by-resource-group
28+
$ScalingPlanExists = (Invoke-RestMethod `
29+
-Headers $AzureManagementHeader `
30+
-Method 'GET' `
31+
-Uri $($ResourceManagerUriFixed + 'subscriptions/' + $SubscriptionId + '/resourceGroups/' + $ResourceGroupName + '/providers/Microsoft.DesktopVirtualization/scalingPlans?api-version=2023-09-05')).value | Where-Object {$_.name -eq $ScalingPlanName}
32+
33+
# Disable autoscale for the host pool: https://learn.microsoft.com/rest/api/desktopvirtualization/scaling-plans/update
34+
if ($ScalingPlanExists)
35+
{
36+
Invoke-RestMethod `
37+
-Body (@{properties = @{hostPoolReferences = @(@{hostPoolArmPath = $HostPoolResourceId; scalingPlanEnabled = $false})}} | ConvertTo-Json -Depth 3) `
38+
-Headers $AzureManagementHeader `
39+
-Method 'PATCH' `
40+
-Uri $($ResourceManagerUriFixed + 'subscriptions/' + $SubscriptionId + '/resourceGroups/' + $ResourceGroupName + '/providers/Microsoft.DesktopVirtualization/scalingPlans/' + $ScalingPlanName + '?api-version=2023-09-05') | Out-Null
41+
}

src/bicep/add-ons/azure-virtual-desktop/artifacts/Set-AzureMarketplaceTerms.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ param (
33
[string]$ImagePublisher,
44
[string]$ImageSku,
55
[string]$ResourceManagerUri,
6+
[string]$SubscriptionId,
67
[string]$UserAssignedIdentityClientId
78
)
89

src/bicep/add-ons/azure-virtual-desktop/artifacts/Set-HostPoolRegistrationToken.ps1

Lines changed: 0 additions & 57 deletions
This file was deleted.

src/bicep/add-ons/azure-virtual-desktop/artifacts/scaling-tool/profile.ps1

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/bicep/add-ons/azure-virtual-desktop/artifacts/scaling-tool/requirements.psd1

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)