Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVD Add-On: Added marketplace terms & other fixes #1134

Merged
merged 48 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
fd098be
Fixed API versions for MAG
jamasten Nov 15, 2024
c4b8716
Added condition for role assignment
jamasten Nov 15, 2024
a94ace0
Fixed API version for MAG
jamasten Nov 15, 2024
d0c461a
Fixed API version for MAG
jamasten Nov 15, 2024
7cf99ae
Compiled bicep changes
jamasten Nov 16, 2024
958ff5e
Moved role definitions, Fixed tags & workspace names
jamasten Nov 16, 2024
7b9873d
Fixed tags
jamasten Nov 16, 2024
d7a316d
Fixed workspace names
jamasten Nov 16, 2024
2e5ab39
Moved role definitions, Fixed tags & comment
jamasten Nov 16, 2024
8b54d1b
Moved role definitions; Fixed scopes, tags, & comments
jamasten Nov 16, 2024
0131db4
Moved role definitions
jamasten Nov 16, 2024
13616ca
Moved role definitions; Fixed tags & comments
jamasten Nov 16, 2024
1d48706
Compiled bicep changes
jamasten Nov 16, 2024
072910f
Sorted params, Added marketplace terms deployment & dependency
jamasten Nov 16, 2024
f3efa46
Added missing params
jamasten Nov 16, 2024
7c2b5f7
Added param for session hosts deployment
jamasten Nov 16, 2024
805ce27
Compiled bicep changes
jamasten Nov 16, 2024
0c17dd8
Added new element for security groups
jamasten Nov 16, 2024
0a87bf2
Added example of security principal, Updated property name for securi…
jamasten Nov 16, 2024
f5e27fc
Compiled bicep changes
jamasten Nov 16, 2024
1c9eaf2
Fixed scopes
jamasten Nov 17, 2024
0e0b442
Fix tags, Simplified subnet resource ID
jamasten Nov 17, 2024
fa41235
Added resources for tagging
jamasten Nov 17, 2024
61558b8
Fixed names for app group & workspaces
jamasten Nov 17, 2024
15c65ec
Fixed tags
jamasten Nov 17, 2024
a870d84
Fixed name for app group
jamasten Nov 17, 2024
b46948c
Removed param
jamasten Nov 17, 2024
ea27f83
Compiled bicep changes
jamasten Nov 17, 2024
e45be94
Fixed app group name
jamasten Nov 17, 2024
4d43075
Added VM plan
jamasten Nov 18, 2024
8ed05a4
Fixed JSON conversion
jamasten Nov 19, 2024
eb80610
Updated role assignment for scaling plan mgmt
jamasten Nov 20, 2024
8574739
Moved control plane to mgmt
jamasten Nov 20, 2024
55ab146
Moved control plane to management
jamasten Nov 20, 2024
e4729de
Added policy & resource group; Updated deployment names; Fixed tags; …
jamasten Nov 21, 2024
286b28e
Moved mgmt step
jamasten Nov 22, 2024
70caacd
Fixed tags
jamasten Nov 23, 2024
22b52fb
Fixed tags
jamasten Nov 23, 2024
0075a59
Updated SKU & PS version
jamasten Nov 25, 2024
4ddd2ae
Moved function resource
jamasten Nov 25, 2024
9c3db3d
Added function resource
jamasten Nov 25, 2024
4155558
Moved function app & function
jamasten Nov 25, 2024
d0102d1
Fixed resource group scope
jamasten Nov 25, 2024
5ca3b7d
Added condition to role assignment
jamasten Nov 26, 2024
f0817c2
Fixed VM size constraints
jamasten Nov 26, 2024
cbaa6b0
Updated naming changes
jamasten Nov 27, 2024
8165e39
Merge branch 'main' into 1129-avd-set-marketplace-terms
jamasten Nov 27, 2024
33ac499
GitHub Action: Build Bicep to JSON
invalid-email-address Nov 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ $AzureManagementHeader = @{
$ScalingPlanExists = (Invoke-RestMethod `
-Headers $AzureManagementHeader `
-Method 'GET' `
-Uri $($ResourceManagerUriFixed + 'subscriptions/' + $SubscriptionId + '/resourceGroups/' + $ResourceGroupName + '/providers/Microsoft.DesktopVirtualization/scalingPlans?api-version=2024-04-03')).value | Where-Object {$_.name -eq $ScalingPlanName}
-Uri $($ResourceManagerUriFixed + 'subscriptions/' + $SubscriptionId + '/resourceGroups/' + $ResourceGroupName + '/providers/Microsoft.DesktopVirtualization/scalingPlans?api-version=2023-09-05')).value | Where-Object {$_.name -eq $ScalingPlanName}

# Disable autoscale for the host pool: https://learn.microsoft.com/rest/api/desktopvirtualization/scaling-plans/update
if ($ScalingPlanExists)
{
Invoke-RestMethod `
-Body (@{properties = @{hostPoolReferences = @(@{hostPoolArmPath = $HostPoolResourceId; scalingPlanEnabled = $false})}} | ConvertTo-Json) `
-Body (@{properties = @{hostPoolReferences = @(@{hostPoolArmPath = $HostPoolResourceId; scalingPlanEnabled = $false})}} | ConvertTo-Json -Depth 3) `
-Headers $AzureManagementHeader `
-Method 'PATCH' `
-Uri $($ResourceManagerUriFixed + 'subscriptions/' + $SubscriptionId + '/resourceGroups/' + $ResourceGroupName + '/providers/Microsoft.DesktopVirtualization/scalingPlans/' + $ScalingPlanName + '?api-version=2024-04-03') | Out-Null
-Uri $($ResourceManagerUriFixed + 'subscriptions/' + $SubscriptionId + '/resourceGroups/' + $ResourceGroupName + '/providers/Microsoft.DesktopVirtualization/scalingPlans/' + $ScalingPlanName + '?api-version=2023-09-05') | Out-Null
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ param (
[string]$ImageOffer,
[string]$ImagePublisher,
[string]$ImageSku,
[string]$ResourceManagerUri
[string]$ResourceManagerUri,
[string]$SubscriptionId,
[string]$UserAssignedIdentityClientId
)

# Fix the resource manager URI since only AzureCloud contains a trailing slash
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ param encryptionUserAssignedIdentityResourceId string
param fileShares array
param fslogixShareSizeInGB int
param fslogixContainerType string
param fslogixStorageService string
param functionAppName string
param hostPoolName string
param hostPoolResourceId string
param keyVaultUri string
param location string
param managementVirtualMachineName string
Expand All @@ -23,9 +21,7 @@ param namingConvention object
param netbios string
param organizationalUnitPath string
param recoveryServicesVaultName string
param resourceGroupControlPlane string
param resourceGroupManagement string
param resourceGroupStorage string
param securityPrincipalObjectIds array
param securityPrincipalNames array
param serviceToken string
Expand All @@ -51,10 +47,10 @@ var smbSettings = {
}
var storageAccountNamePrefix = uniqueString(replace(namingConvention.storageAccount, serviceToken, 'file-fslogix'), resourceGroup().id)
var storageRedundancy = availability == 'availabilityZones' ? '_ZRS' : '_LRS'
var tagsPrivateEndpoints = union({'cm-resource-parent': '${subscription().id}}/resourceGroups/${resourceGroupControlPlane}/providers/Microsoft.DesktopVirtualization/hostpools/${hostPoolName}'}, contains(tags, 'Microsoft.Network/privateEndpoints') ? tags['Microsoft.Network/privateEndpoints'] : {}, mlzTags)
var tagsStorageAccounts = union({'cm-resource-parent': '${subscription().id}}/resourceGroups/${resourceGroupControlPlane}/providers/Microsoft.DesktopVirtualization/hostpools/${hostPoolName}'}, contains(tags, 'Microsoft.Storage/storageAccounts') ? tags['Microsoft.Storage/storageAccounts'] : {}, mlzTags)
var tagsRecoveryServicesVault = union({'cm-resource-parent': '${subscription().id}}/resourceGroups/${resourceGroupControlPlane}/providers/Microsoft.DesktopVirtualization/hostpools/${hostPoolName}'}, contains(tags, 'Microsoft.recoveryServices/vaults') ? tags['Microsoft.recoveryServices/vaults'] : {}, mlzTags)
var tagsVirtualMachines = union({'cm-resource-parent': '${subscription().id}}/resourceGroups/${resourceGroupControlPlane}/providers/Microsoft.DesktopVirtualization/hostpools/${hostPoolName}'}, contains(tags, 'Microsoft.Compute/virtualMachines') ? tags['Microsoft.Compute/virtualMachines'] : {}, mlzTags)
var tagsPrivateEndpoints = union({'cm-resource-parent': hostPoolResourceId}, tags[?'Microsoft.Network/privateEndpoints'] ?? {}, mlzTags)
var tagsStorageAccounts = union({'cm-resource-parent': hostPoolResourceId}, tags[?'Microsoft.Storage/storageAccounts'] ?? {}, mlzTags)
var tagsRecoveryServicesVault = union({'cm-resource-parent': hostPoolResourceId}, tags[?'Microsoft.recoveryServices/vaults'] ?? {}, mlzTags)
var tagsVirtualMachines = union({'cm-resource-parent': hostPoolResourceId}, tags[?'Microsoft.Compute/virtualMachines'] ?? {}, mlzTags)

resource storageAccounts 'Microsoft.Storage/storageAccounts@2022-09-01' = [for i in range(0, storageCount): {
name: take('${storageAccountNamePrefix}${padLeft(i + storageIndex, 2, '0')}', 15)
Expand Down Expand Up @@ -206,6 +202,7 @@ resource privateDnsZoneGroups 'Microsoft.Network/privateEndpoints/privateDnsZone
]
}]

// Sets NTFS permissions on the file shares
module ntfsPermissions '../runCommand.bicep' = {
name: 'set-ntfs-permissions-${deploymentNameSuffix}'
scope: resourceGroup(resourceGroupManagement)
Expand Down Expand Up @@ -245,7 +242,7 @@ module ntfsPermissions '../runCommand.bicep' = {
}
{
name: 'StorageAccountResourceGroupName'
value: resourceGroupStorage
value: resourceGroup().name
}
{
name: 'StorageCount'
Expand Down Expand Up @@ -283,6 +280,7 @@ module ntfsPermissions '../runCommand.bicep' = {
]
}

// Deploys backup items for Azure Files
module recoveryServices 'recoveryServices.bicep' = if (enableRecoveryServices) {
name: 'deploy-backup-${deploymentNameSuffix}'
scope: resourceGroup(resourceGroupManagement)
Expand All @@ -291,7 +289,7 @@ module recoveryServices 'recoveryServices.bicep' = if (enableRecoveryServices) {
fileShares: fileShares
location: location
recoveryServicesVaultName: recoveryServicesVaultName
resourceGroupStorage: resourceGroupStorage
resourceGroupStorage: resourceGroup().name
storageAccountNamePrefix: storageAccountNamePrefix
storageCount: storageCount
storageIndex: storageIndex
Expand All @@ -302,22 +300,4 @@ module recoveryServices 'recoveryServices.bicep' = if (enableRecoveryServices) {
]
}

module autoIncreaseStandardFileShareQuota '../../common/function.bicep' = if (fslogixStorageService == 'AzureFiles Premium' && storageCount > 0) {
name: 'deploy-file-share-scaling-${deploymentNameSuffix}'
scope: resourceGroup(resourceGroupManagement)
params: {
files: {
'requirements.psd1': loadTextContent('../../../artifacts/auto-increase-file-share/requirements.psd1')
'run.ps1': loadTextContent('../../../artifacts/auto-increase-file-share/run.ps1')
'../profile.ps1': loadTextContent('../../../artifacts/auto-increase-file-share/profile.ps1')
}
functionAppName: functionAppName
functionName: 'auto-increase-file-share-quota'
schedule: '0 */15 * * * *'
}
dependsOn: [
recoveryServices
]
}

output storageAccountNamePrefix string = storageAccountNamePrefix
Loading