Error:
==> azure-arm: Waiting for deletion of all resources…
==> azure-arm: Attempting deletion → Microsoft.KeyVault/vaults : ‘pkrkvx91i6lr44q’
==> azure-arm: Removing the created Deployment object: ‘kvpkrdpx91i6lr44q’
==> azure-arm:
==> azure-arm: Cleanup requested, deleting resource group …
==> azure-arm: Resource group has been deleted.
Build ‘azure-arm’ errored after 25 minutes 45 seconds: Timeout waiting for SSH.
==> Wait completed after 25 minutes 45 seconds
==> Some builds didn’t complete successfully and had errors:
→ azure-arm: Timeout waiting for SSH.
==> Builds finished but no artifacts were created.
Code file:
{
"builders": [{
"type": "azure-arm",
"client_id": "f894666e-8e3c-4275-8366-9fc7c78e4f44",
"client_secret": "1WI8Q~KBO_b3-lp3mR54btpnKr8u4b-6EtUJ1axP",
"tenant_id": "8e0b6750-ef80-4f5b-98b3-fa2b9f690006",
"subscription_id": "93048f2d-2d0f-44cc-b12c-4df25a3c5ff5",
"shared_image_gallery_destination": {
"subscription": "93048f2d-2d0f-44cc-b12c-4df25a3c5ff5",
"resource_group": "cg",
"gallery_name": "gallery1",
"image_name": "webserver",
"image_version": "1.0.1",
"replication_regions": [ "EastUS2" ],
"storage_account_type": "Standard_LRS"
},
"os_type": "windows",
"image_publisher": "MicrosoftWindowsServer",
"image_offer": "WindowsServer",
"image_sku": "2016-Datacenter",
"azure_tags": {
"dept": "Engineering",
"task": "Image deployment"
},
"location": "East US2",
"vm_size": "Standard_D4s_v5"
}],
"provisioners": [{
"type": "powershell",
"inline": [
"Add-WindowsFeature Web-Server",
"while ((Get-Service RdAgent).Status -ne 'Running') { Start-Sleep -s 5 }",
"while ((Get-Service WindowsAzureGuestAgent).Status -ne 'Running') { Start-Sleep -s 5 }",
"& $env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /quiet /quit",
"while($true) { $imageState = Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\State | Select ImageState; if($imageState.ImageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') { Write-Output $imageState.ImageState; Start-Sleep -s 10 } else { break } }"
]
}]
}