Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
a367475
Update portal-ui.json
stefze Aug 19, 2024
c492d13
Update DeployAVDSessionHostReplacer.json
stefze Aug 19, 2024
4d4e6b5
Update portal-ui.json
stefze Aug 19, 2024
4c8a040
Update DeployAVDSessionHostReplacer.json
stefze Aug 23, 2024
ad9f5e8
Add files via upload
stefze Sep 5, 2024
149b45e
Add files via upload
stefze Sep 5, 2024
b87ac26
Update README.md
stefze Sep 5, 2024
d184d39
Update DeployAVDSessionHostReplacer.json
stefze Sep 5, 2024
8283932
Update README.md
stefze Sep 5, 2024
de05c30
Update DeployAVDSessionHostReplacer.json
stefze Sep 5, 2024
8ba321d
Update DeployAVDSessionHostReplacer.json
stefze Sep 5, 2024
326d239
Update DeployAVDSessionHostReplacer.json
stefze Sep 5, 2024
1b6407a
Update DeployAVDSessionHostReplacer.json
stefze Sep 5, 2024
874984c
Update DeployAVDSessionHostReplacer.json
stefze Sep 8, 2024
05d93f0
Update DeployAVDSessionHostReplacer.json
stefze Sep 8, 2024
06006fb
Update DeployAVDSessionHostReplacer.json
stefze Sep 8, 2024
2063cd1
Update DeployAVDSessionHostReplacer.json
stefze Sep 8, 2024
84712de
Update DeployAVDSessionHostReplacer.json
stefze Sep 8, 2024
6c7948c
Update DeployAVDSessionHostReplacer.json
stefze Sep 8, 2024
9e7eaa5
Update DeployAVDSessionHostReplacer.json
stefze Sep 8, 2024
0be05e1
Update DeployAVDSessionHostReplacer.json
stefze Sep 8, 2024
019b6e9
Update DeployAVDSessionHostReplacer.json
stefze Sep 8, 2024
3fd72a4
Update DeployAVDSessionHostReplacer.json
stefze Sep 8, 2024
cb7796b
Update portal-ui.json
stefze Sep 8, 2024
b3ee5b2
Update DeployAVDSessionHostReplacer.json
stefze Sep 9, 2024
c6ce020
Update DeployAVDSessionHostReplacer.json
stefze Sep 17, 2024
0be8ab1
Update DeploySessionHosts.json
stefze May 9, 2025
96bc414
Updated bundle version
stefze Jan 5, 2026
a137d81
updated base image selector
stefze Jan 5, 2026
4ea1dea
updated base image selector
stefze Jan 5, 2026
4948914
Update PowerShell version to 7.4
stefze Jan 5, 2026
1df05b1
Updated-hibernation-disksize-dns
stefze Jan 5, 2026
066b1b7
fix image
stefze Jan 5, 2026
03da969
Replace win11-25h2-avd-m365 with win11-23h2-avd-m365
stefze Jan 5, 2026
4bb8f3c
updated function app url
stefze Jan 5, 2026
fdebe9e
Add files via upload
stefze Jan 5, 2026
30e3662
Update FunctionAppZipUrl to new GitHub location
stefze Jan 5, 2026
bdee8a2
Update FunctionAppZipUrl to point to latest release
stefze Jan 5, 2026
1bd2972
Add files via upload
stefze Jan 6, 2026
f43c3d7
Update DeployAVDSessionHostReplacer.json
stefze Jan 6, 2026
30e82fd
Updated template specs
stefze Jan 6, 2026
eb10695
Update DNS Servers
stefze Jan 6, 2026
d1510ee
Add DNS text box
stefze Jan 6, 2026
84b05fd
Fix JSON formatting in portal-ui.json
stefze Jan 6, 2026
0202fb6
Add DiskSizeGB input field and update DnsSettings
stefze Jan 6, 2026
722dafe
Change DiskSizeGB to Slider with new constraints
stefze Jan 6, 2026
8cc75fb
Change default OS Disk Size from 128 to 64 GB
stefze Jan 6, 2026
cd97dd2
Change default OS disk size to 128 GB
stefze Jan 6, 2026
f830744
Remove OS Disk Size configuration
stefze Jan 6, 2026
75a9e18
Add OS Disk Size parameter to portal-ui.json
stefze Jan 6, 2026
7723023
Update SessionHostParameters to include DiskSizeGB
stefze Jan 6, 2026
f0bd2e2
Add OS disk size parameter to AVD session host
stefze Jan 6, 2026
9b1cb72
Remove DNS settings from portal-ui.json
stefze Jan 6, 2026
cfd46c0
Add DNS settings section to portal UI configuration
stefze Jan 6, 2026
06c3bb4
Add subscriptionId to portal-ui.json outputs
stefze Jan 6, 2026
5bc3261
Fix DnsServers array creation in portal-ui.json
stefze Jan 6, 2026
9ddae11
Update portal-ui.json with subscription and resource group details
stefze Jan 6, 2026
738bb1d
Update resource outputs in portal-ui.json
stefze Jan 6, 2026
cf89958
Update print statement from 'Hello' to 'Goodbye'
stefze Jan 6, 2026
2db63e4
Update print statement from 'Hello' to 'Goodbye'
stefze Jan 6, 2026
1cc5688
Update AVD session host configurations
stefze Jan 6, 2026
86fcd43
Change greeting from 'Hello' to 'Goodbye'
stefze Jan 6, 2026
dc17d1f
Update print statement from 'Hello' to 'Goodbye'
stefze Jan 6, 2026
6beeaf3
Rename FunctionAppZipUrl to FunctionAppUrl
stefze Jan 6, 2026
b4587c6
Add DNS settings to portal-ui configuration
stefze Jan 6, 2026
6820385
Update print statement to say 'Goodbye World'
stefze Jan 6, 2026
dce9241
Update DNS server description and add DiskSizeGB parameter
stefze Jan 6, 2026
814a123
Remove location from RBAC deployment configurations
stefze Jan 6, 2026
5825015
Update print statement to say 'Goodbye World'
stefze Jan 6, 2026
c9bc0d9
Fix JSON syntax in DeployAVDSessionHostReplacer
stefze Jan 6, 2026
e93a23e
Update packageUri parameter in AVD deployment JSON
stefze Jan 6, 2026
c20fe84
Add files via upload
stefze Mar 5, 2026
783b418
Disable host removal and add managed suffix baseline
Mar 23, 2026
7aeabbf
Update README for no-decommission behavior
Mar 23, 2026
dcb0f96
Disable timerTrigger1 by default in all templates
Mar 23, 2026
e64b10f
Bind FunctionApp zip URL to deployment branch
Mar 23, 2026
0c0a57c
Use onedeploy for FunctionApp package deployment
Mar 23, 2026
5463656
Set OneDeploy artifact type to zip
Mar 23, 2026
8dd17c6
Update Function deployment templates for PS 7.4 and OneDeploy zip
Mar 23, 2026
b2a0dea
Update DeployAVDSessionHostReplacer ARM template
Mar 23, 2026
611ead0
Update deployment artifacts and package outputs
Mar 23, 2026
cc67e9d
Replace deployment zip artifact
Mar 23, 2026
7ecef42
Switch FunctionApp zip references to main branch
Mar 23, 2026
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
19 changes: 16 additions & 3 deletions Build/Bicep/FunctionApps.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ param SessionHostResourceGroupName string = ''
@description('Required: Yes | Name of the Azure Virtual Desktop Host Pool.')
param HostPoolName string

@description('Required: No | URL of the FunctionApp.zip file. This is the zip file containing the Function App code. | Default: The latest release of the Function App code.')
param FunctionAppZipUrl string = 'https://github.com/WillyMoselhy/AVDReplacementPlans/releases/download/v0.1.5/FunctionApp.zip' // TODO - Update this to the new URL under Azure Org
@description('Required: No | URL of the FunctionApp.zip package. By default, this is derived from the current template URL so it follows the deployed repo branch automatically.')
param FunctionAppZipUrl string = contains(deployment().properties, 'templateLink') && !empty(deployment().properties.templateLink.uri)
? uri(replace(split(deployment().properties.templateLink.uri, '?')[0], 'DeployAVDSessionHostReplacer.json', ''), '../../FunctionApp/FunctionApp.zip')
: 'https://github.com/WillyMoselhy/AVDReplacementPlans/releases/download/v0.1.5/FunctionApp.zip'

@description('Required: No | If true, will apply tags for Include In Auto Replace and Deployment Timestamp to existing session hosts. This will not enable automatic deletion of existing session hosts. | Default: True.')
param FixSessionHostTags bool = true
Expand Down Expand Up @@ -82,6 +84,9 @@ param SubnetId string
@description('Required: No | Number of digits to use for the instance number of the session hosts (eg. AVDVM-01). | Default: 2')
param SessionHostInstanceNumberPadding int = 2

@description('Required: No | Minimum numeric suffix for managed session hosts. Hosts below this suffix are ignored when calculating how many new hosts to deploy. | Default: 1025')
param ManagedSessionHostMinSuffix int = 1025

@description('Required: No | If true, will replace session hosts when a new image version is detected. | Default: true')
param ReplaceSessionHostOnNewImageVersion bool = true

Expand All @@ -106,6 +111,10 @@ var varFunctionAppSettings = [
name: 'FUNCTIONS_WORKER_RUNTIME'
value: 'powershell'
}
{
name: 'AzureWebJobs.timerTrigger1.Disabled'
value: '1'
}
{
name: 'AzureWebJobsStorage'
value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};EndpointSuffix=${environment().suffixes.storage};AccountKey=${storageAccount.listKeys().keys[0].value}'
Expand Down Expand Up @@ -170,6 +179,10 @@ var varFunctionAppSettings = [
name: '_SessionHostInstanceNumberPadding'
value: SessionHostInstanceNumberPadding
}
{
name: '_ManagedSessionHostMinSuffix'
value: ManagedSessionHostMinSuffix
}
{
name: '_TargetSessionHostCount'
value: TargetSessionHostCount
Expand Down Expand Up @@ -286,7 +299,7 @@ resource functionApp 'Microsoft.Web/sites@2022-03-01' = {
serverFarmId: appServicePlan.id
siteConfig: {
use32BitWorkerProcess: false
powerShellVersion: '7.2'
powerShellVersion: '7.4'
netFrameworkVersion: 'v6.0'
appSettings: varFunctionAppSettings
ftpsState: 'Disabled'
Expand Down
1 change: 1 addition & 0 deletions FunctionApp/FunctionParameters.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
_IncludePreExistingSessionHosts = @{Required = $false ; Type = 'bool ' ; Default = $false ; Description = 'When enabled, the Session Host Replacer will automatically consider pre-existing VMs for replacement if they meet the criteria by setting the IncludeInAutomation tag to True during the first run. When disabled, the session hosts are not counted as part of the target number of VMs. You can manually include a VM after deployment by updating its tag.' }
_SHRDeploymentPrefix = @{Required = $false ; Type = 'string' ; Default = 'AVDSessionHostReplacer' ; Description = '' }
_SessionHostInstanceNumberPadding = @{Required = $false ; Type = 'int ' ; Default = 2 ; Description = '' }
_ManagedSessionHostMinSuffix = @{Required = $false ; Type = 'int ' ; Default = 1025 ; Description = 'Minimum numeric suffix to consider when calculating target host count and allocating new VM names.' }
_ReplaceSessionHostOnNewImageVersion = @{Required = $false ; Type = 'bool ' ; Default = $true ; Description = '' }
_ReplaceSessionHostOnNewImageVersionDelayDays = @{Required = $false ; Type = 'int ' ; Default = 0 ; Description = '' }
_VMNamesTemplateParameterName = @{Required = $false ; Type = 'string' ; Default = 'VMNames' ; Description = 'The name of the array parameter used in the Session Host deployment template to define the VM names. Default is "VMNames"' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ function Deploy-SHRSessionHost {
[Parameter()]
[int] $SessionHostInstanceNumberPadding = (Get-FunctionConfig _SessionHostInstanceNumberPadding),

[Parameter()]
[int] $ManagedSessionHostMinSuffix = (Get-FunctionConfig _ManagedSessionHostMinSuffix),

[Parameter()]
[string] $DeploymentPrefix = (Get-FunctionConfig _SHRDeploymentPrefix),

Expand All @@ -51,13 +54,14 @@ function Deploy-SHRSessionHost {

# Calculate Session Host Names
Write-PSFMessage -Level Host -Message "Existing session host VM names: {0}" -StringValues ($ExistingSessionHostVMNames -join ',')
$vmNumber = [Math]::Max(1, $ManagedSessionHostMinSuffix)
[array] $sessionHostNames = for ($i = 0; $i -lt $NewSessionHostsCount; $i++) {
$vmNumber = 1
While (("$SessionHostNamePrefix$SessionHostNameSeparator{0:d$SessionHostInstanceNumberPadding}" -f $vmNumber) -in $ExistingSessionHostVMNames) {
$vmNumber++
}
$vmName = "$SessionHostNamePrefix$SessionHostNameSeparator{0:d$SessionHostInstanceNumberPadding}" -f $vmNumber
$ExistingSessionHostVMNames += $vmName
$vmNumber++
$vmName
}
Write-PSFMessage -Level Host -Message "Creating session host(s) {0}" -StringValues ($sessionHostNames -join ',')
Expand Down
Loading