Reputation: 1
I have been tasked with automating our image deployment process for our Azure Virtual Desktop Environment. I came across Azure Image Builder and specificaly the "Custom Image Templates" for Azure Virtual Desktop which seems like a relatively simple way to achieve this.
While creating some test AIB templates i ran into the following problem. When adding any kind of powershell script customizers, be it inline or from a URI, the template creation fails with the following error message:
"provisioningState": "Failed",
"provisioningError": {
"provisioningErrorCode": "NoCustomizerScript",
"message": "Internal error occurred. This is a generic error. To identify possible causes, go to https://aka.ms/azvmimagebuilderts."
},
When i use non powershell script customizers like "Perform Windows Restart" or "Perform Windows Update" the AIB template seems to provision just fine. While creating the Image Template i have followed the documentation https://learn.microsoft.com/en-us/azure/virtual-desktop/custom-image-templates
and made sure all requirements were met. I also did not specify a staging RG or VNET and configured the output to be a shared image gallery.
Below the full .JSON for the customizer, this is a default configuration using built-in scripts provided by Azure Virtual Desktop Custom Image Templates. I have replaced the script URI's to prevent being marked as spam but they all point to a script in raw.githubusercontent.com/Azure/RDS-Templates/master/
:
"customize": [
{
"destination": "C:\\AVDImage\\installLanguagePacks.ps1",
"name": "avdBuiltInScript_installLanguagePacks",
"sourceUri": "example.com",
"type": "File"
},
{
"inline": [
"C:\\AVDImage\\installLanguagePacks.ps1 -LanguageList \" [REDACTED] \""
],
"name": "avdBuiltInScript_installLanguagePacks-parameter",
"runAsSystem": true,
"runElevated": true,
"type": "PowerShell"
},
{
"name": "avdBuiltInScript_installLanguagePacks-windowsUpdate",
"searchCriteria": "",
"type": "WindowsUpdate",
"updateLimit": 0
},
{
"name": "avdBuiltInScript_installLanguagePacks-windowsRestart",
"restartCheckCommand": "",
"restartCommand": "",
"restartTimeout": "10m",
"type": "WindowsRestart"
},
{
"destination": "C:\\AVDImage\\setDefaultLanguage.ps1",
"name": "avdBuiltInScript_setDefaultLanguage",
"sourceUri": "example.com",
"type": "File"
},
{
"inline": [
"C:\\AVDImage\\setDefaultLanguage.ps1 -Language \"[REDACTED]\""
],
"name": "avdBuiltInScript_setDefaultLanguage-parameter",
"runAsSystem": true,
"runElevated": true,
"type": "PowerShell"
},
{
"name": "avdBuiltInScript_setDefaultLanguage-windowsUpdate",
"searchCriteria": "",
"type": "WindowsUpdate",
"updateLimit": 0
},
{
"name": "avdBuiltInScript_setDefaultLanguage-windowsRestart",
"restartCheckCommand": "",
"restartCommand": "",
"restartTimeout": "5m",
"type": "WindowsRestart"
},
{
"name": "avdBuiltInScript_disableStorageSense",
"runAsSystem": true,
"runElevated": true,
"scriptUri": "example.com",
"type": "PowerShell"
},
{
"destination": "C:\\AVDImage\\multiMediaRedirection.ps1",
"name": "avdBuiltInScript_multiMediaRedirection",
"sourceUri": "example.com",
"type": "File"
},
{
"inline": [
"C:\\AVDImage\\multiMediaRedirection.ps1 -VCRedistributableLink \"https://aka.ms/vs/17/release/vc_redist.x64.exe\" -EnableEdge \"false\" -EnableChrome \"false\""
],
"name": "avdBuiltInScript_multiMediaRedirection-parameter",
"runAsSystem": true,
"runElevated": true,
"type": "PowerShell"
},
{
"destination": "C:\\AVDImage\\windowsOptimization.ps1",
"name": "avdBuiltInScript_windowsOptimization",
"sourceUri": "example.com",
"type": "File"
},
{
"inline": [
"C:\\AVDImage\\windowsOptimization.ps1 -Optimizations \"DiskCleanup\",\"NetworkOptimizations\",\"Services\""
],
"name": "avdBuiltInScript_windowsOptimization-parameter",
"runAsSystem": true,
"runElevated": true,
"type": "PowerShell"
},
{
"name": "avdBuiltInScript_windowsOptimization-windowsUpdate",
"searchCriteria": "",
"type": "WindowsUpdate",
"updateLimit": 0
},
{
"name": "avdBuiltInScript_windowsOptimization-windowsRestart",
"restartCheckCommand": "",
"restartCommand": "",
"restartTimeout": "",
"type": "WindowsRestart"
},
{
"destination": "C:\\AVDImage\\removeAppxPackages.ps1",
"name": "avdBuiltInScript_removeAppxPackages",
"sourceUri": "example.com",
"type": "File"
},
{
"inline": [
"C:\\AVDImage\\removeAppxPackages.ps1 -AppxPackages \"Microsoft.XboxApp\",\"Microsoft.YourPhone\",\"Microsoft.XboxSpeechToTextOverlay\",\"Microsoft.XboxIdentityProvider\",\"Microsoft.XboxGamingOverlay\",\"Microsoft.XboxGameOverlay\",\"Microsoft.Xbox.TCUI\",\"Microsoft.WindowsFeedbackHub\",\"Microsoft.windowscommunicationsapps\",\"Microsoft.SkypeApp\",\"Microsoft.MicrosoftStickyNotes\",\"Microsoft.MicrosoftSolitaireCollection\",\"Microsoft.GamingApp\",\"Microsoft.GetHelp\",\"Microsoft.Getstarted\",\"Microsoft.BingWeather\",\"Microsoft.BingNews\",\"Clipchamp.Clipchamp\""
],
"name": "avdBuiltInScript_removeAppxPackages-parameter",
"runAsSystem": true,
"runElevated": true,
"type": "PowerShell"
},
{
"name": "avdBuiltInScript_windowsUpdate",
"searchCriteria": "",
"type": "WindowsUpdate",
"updateLimit": 0
},
{
"name": "avdBuiltInScript_windowsUpdate-windowsRestart",
"restartCheckCommand": "",
"restartCommand": "",
"restartTimeout": "",
"type": "WindowsRestart"
},
{
"name": "avdBuiltInScript_adminSysPrep",
"runAsSystem": true,
"runElevated": true,
"scriptUri": "example.com",
"type": "PowerShell"
}
],
I have tried to build AIB image templates with multiple combinations of customizers, they all seem to fail in the build-process when adding a powershell script component.
Upvotes: 0
Views: 24