-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Issues using New-AzImageBuilderTemplate to load from json #18924
Comments
Thanks for reporting. We suspect it is due to Az.ImageBuilder module is using old API version. We will upgrade API version and please try again. You can expect new version of that at the beginning of September. Template solution is you can send request by |
Confirm that upgrading API version will resolve this issue. I tried API 2022-02-14 with json file below. replicationRegions is sent successfully in new API version. {
"location": "northcentralus",
"tags": {
"userIdentity": "enabled",
"CostCenter": "*"
},
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/*/resourcegroups/*/providers/Microsoft.ManagedIdentity/userAssignedIdentities/*": {}
}
},
"properties": {
"buildTimeoutInMinutes" : 120,
"source": {
"type": "PlatformImage",
"publisher": "MicrosoftWindowsDesktop",
"offer": "windows-10",
"sku": "20h2-ent",
"version": "latest"
},
"customize": [
{
"type": "PowerShell",
"name": "GetAzCopy",
"runElevated": true,
"runAsSystem": true,
"inline": [
"Write-Host \"Copying AzCopy\"",
"New-Item -ItemType Directory -Path \"C:\\\" -Name TEMP",
"New-Item -ItemType Directory -Path \"C:\\TEMP\" -Name Apps",
"Invoke-WebRequest -URI \"https://aka.ms/downloadazcopy-v10-windows\" -OutFile \"C:\\TEMP\\azcopy.zip\"",
"Expand-Archive \"C:\\TEMP\\azcopy.zip\" \"C:\\TEMP\"",
"Copy-Item \"C:\\TEMP\\azcopy_windows_amd64_*\\azcopy.exe\\\" -Destination \"C:\\TEMP\""
]
},
{
"type": "PowerShell",
"name": "Disable Firewall",
"inline": [
"netsh advfirewall set domainprofile state off"
]
},
{
"type": "PowerShell",
"name": "Enable Remote Connections",
"runElevated": true,
"runAsSystem": true,
"inline": [
"Set-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\" -Name fDenyTSConnections -Type DWORD -Value 0 -Force"
]
},
{
"type": "PowerShell",
"name": "Copy Test Script",
"runElevated": true,
"runAsSystem": true,
"inline": [
"New-Item -ItemType Directry -Path C:\\PerrigoAppInstalls",
"AzCopy .\\Copyfiles.vbs C:\\PerrigoAppInstalls"
]
},
{
"type": "PowerShell",
"name": "Timezone Redirect",
"runElevated": true,
"runAsSystem": true,
"scriptUri": "https://raw.githubusercontent.com/bferg317/ImageBuilder/master/timezoneredirect.ps1"
},
{
"type": "WindowsUpdate",
"searchCriteria": "IsInstalled=0",
"filters": [
"exclude:$_.Title -like \"*Preview*\"",
"include:$true"
],
"updateLimit": 40
},
{
"type": "PowerShell",
"name": "Debug Placeholder",
"runElevated": true,
"runAsSystem": true,
"inline": [
"Write-Host \"C30\""
]
},
{
"type": "PowerShell",
"name": "SysprepFix",
"runElevated": true,
"runAsSystem": true,
"scriptUri": "https://raw.githubusercontent.com/bferg317/ImageBuilder/master/sysprepfix.ps1"
},
{
"type": "WindowsRestart",
"restartCheckCommand": "Write-Host 'Final reboot before capture.'",
"restartTimeout": "5m"
}
],
"distribute":
[
{
"type": "SharedImage",
"galleryImageId": "/subscriptions/*/resourceGroups/*/providers/Microsoft.Compute/galleries/*/images/*-image",
"runOutputName": "AIB-NetTest",
"artifactTags": {
"source": "wvd10",
"baseosimg": "windows10",
"workflow": "aib-general",
"CostCenter": "0010137100"
},
"replicationRegions": [
"northcentralus"
]
}
]
}
} |
Please expect this issue fixed in Az.ImageBuilder 0.3.0. It will be release on Sept 6th. |
Description
I'm having trouble using New-AzImageBuilderTemplate to load my json templates. The error seems to indicate the module cannot extract parameters. Specifically, it seems to fail at extracting the
replicationRegions
parameter. The parameter is filled correctly (and is the same region as the target gallery per doc.I am simply filling in our own parameters from the quickstart template here, and adding our own customizers, the latter of which have no bearing on failing validation like this. The only major structural change was to strip this down to just the
resources
block. Again, documentation is either out of date or unclear on proper use of AIB but this seems to be required to get even this far.The redacted template is pasted here:
aib-gen-20h2-0712-redacted.txt
Script or Debug output
Environment data
Module versions
Error output
The text was updated successfully, but these errors were encountered: