Closed ranjit01 closed 3 years ago
Hi @ranjit01 - Can you raise a case here and I will triage this with the CSS team please? https://github.com/danielsollondon/azvmimagebuilder/blob/master/troubleshootingaib.md#troubleshooting-azure-vm-image-build-aib-failures
Repro steps:
#Requires -RunAsAdministrator Set-StrictMode -Version Latest $ErrorActionPreference = "Stop" Write-Host "Enable feature: KeyboardFilter" Enable-WindowsOptionalFeature -Online -FeatureName Client-KeyboardFilter -All -NoRestart
My customizer in azure image builder json looks like this:
"customize": [ { "type": "PowerShell", "name": "Run ConfigureOS.ps1", "runElevated": true, "scriptUri": "https://myazurestoragefoobar.blob.core.windows.net/mycontainer/ConfigureOS.ps1" }, { "type": "WindowsRestart", "restartCommand": "shutdown /r /f /t 0", "restartTimeout": "5m" },
Expected result: Successful run of configureOS.ps1 as part of image builder.
Actual result: Build fails, and only line in customization.log is below. Does not give much information about what really went wrong. `
ResourceNotFound
`
I also tried as part of customization to download ConfigureOS.ps1 file locally using file customizer and the executing it locally, but even that didn't work and I got same error in customization.log
What works? Instead of trying to enable windows feature from a ps1 script, if I directly add that command as inline in a powershell customizer, that works fine! Basically, following works:
"customize": [ { "type": "PowerShell", "name": "Enable Windows optional feature - KeyboardFilter", "inline": [ "Enable-WindowsOptionalFeature -Online -FeatureName Client-KeyboardFilter -All -NoRestart" ], "runElevated": true }, { "type": "WindowsRestart", "restartCommand": "shutdown /r /f /t 0", "restartTimeout": "5m" },