Dominic Böttger
Feb 07, 2022Copper Contributor
Status:
Tell us more
Autoscaling virtual Desktop incompatible with ARM / BICEP Deployment
In the current version of Autoscaling we get deployment errors for all machines which are shut down during a new deployment. The system tries to update the Powershell DSC module every time even w...
Dominic Böttger
Mar 16, 2022Copper Contributor
I did not figure out any solution. I also checked if I could check in den bicep file if the extension already exists, but this does not seem to be possible.
The deployment fails every single time when one of the machines have been shut down by the autoscaler as it tries to deploy the extensions every single time.
This is my current configuration:
param registrationToken string
param hostpoolName string
param vmName string
param location string
param machineImage string
param machineImageGalleryRG string
param vmAdminUser string
param vmAdminPassword string
param subnetId string
var storageSuffix = environment().suffixes.storage
var modulesDSCUrl = 'https://wvdportalstorageblob.blob.${storageSuffix}/galleryartifacts/Configuration_8-3-2021.zip'
resource networkInterfaces_resource 'Microsoft.Network/networkInterfaces@2020-11-01' = {
name: '${vmName}-nic'
location: location
properties: {
ipConfigurations: [
{
name: 'ipconfig'
properties: {
privateIPAllocationMethod: 'Dynamic'
subnet: {
id: subnetId
}
primary: true
privateIPAddressVersion: 'IPv4'
}
}
]
enableAcceleratedNetworking: false
enableIPForwarding: false
}
}
resource MachineImage 'Microsoft.Compute/galleries/images/versions@2021-07-01' existing = {
name: machineImage
scope: resourceGroup(machineImageGalleryRG)
}
resource virtualMachines_resource 'Microsoft.Compute/virtualMachines@2021-07-01' = {
name: vmName
location: location
identity: {
type: 'SystemAssigned'
}
properties: {
hardwareProfile: {
vmSize: 'Standard_B4ms'
}
storageProfile: {
imageReference: {
id: MachineImage.id
}
osDisk: {
createOption: 'FromImage'
managedDisk: {
storageAccountType: 'StandardSSD_LRS'
}
diskSizeGB: 256
}
dataDisks: []
}
osProfile: {
computerName: vmName
adminUsername: vmAdminUser
adminPassword: vmAdminPassword
windowsConfiguration: {
provisionVMAgent: true
enableAutomaticUpdates: true
patchSettings: {
patchMode: 'AutomaticByOS'
assessmentMode: 'ImageDefault'
}
}
secrets: []
allowExtensionOperations: true
}
networkProfile: {
networkInterfaces: [
{
id: networkInterfaces_resource.id
}
]
}
diagnosticsProfile: {
bootDiagnostics: {
enabled: true
}
}
licenseType: 'Windows_Client'
}
}
var aadLoginExtensionName = 'AADLoginForWindows'
resource virtualMachineName_aadLoginExtensionName 'Microsoft.Compute/virtualMachines/extensions@2021-04-01' = {
parent: virtualMachines_resource
name: aadLoginExtensionName
location: location
properties: {
publisher: 'Microsoft.Azure.ActiveDirectory'
type: aadLoginExtensionName
typeHandlerVersion: '1.0'
autoUpgradeMinorVersion: true
settings: {
mdmId: '0000000a-0000-0000-c000-000000000000'
}
}
}
resource virtualMachines_name_Microsoft_PowerShell_DSC 'Microsoft.Compute/virtualMachines/extensions@2021-03-01' = {
parent: virtualMachines_resource
name: 'Microsoft.PowerShell.DSC'
location: location
properties: {
autoUpgradeMinorVersion: true
publisher: 'Microsoft.Powershell'
type: 'DSC'
typeHandlerVersion: '2.80'
settings: {
modulesUrl: modulesDSCUrl
configurationFunction: 'Configuration.ps1\\AddSessionHost'
properties: {
hostPoolName: hostpoolName
registrationInfoToken: registrationToken
aadJoin: false
}
}
protectedSettings: {}
}
}