Build Azure managed image by Packer issue

Hi, All

I’m newer from Packer, so I have following the documentation on Microsoft Azure and Packer.io as below

I have some issue now, please check my step below

  1. Deploy the Packer JSON file to build the managed image to Azure
  2. Without any error message from the Packer process and I saw the managed image created on Azure.
  3. I’m Create the new Virtual Machine using this managed image but it will be failed

Failed message from Azure:
{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"OSProvisioningTimedOut","message":"OS Provisioning for VM 'vm-test' did not finish in the allotted time. The VM may still finish provisioning successfully. Please check provisioning state later. Also, make sure the image has been properly prepared (generalized).\r\n * Instructions for Windows: https://azure.microsoft.com/documentation/articles/virtual-machines-windows-upload-image/ \r\n * Instructions for Linux: https://azure.microsoft.com/documentation/articles/virtual-machines-linux-capture-image/ \r\n * If you are deploying more than 20 Virtual Machines concurrently, consider moving your custom image to shared image gallery. Please refer to https://aka.ms/movetosig for the same."}]}

My Packer JSON file:
{
“builders”: [{
“type”: “azure-arm”,
“client_id”: “{{user azure-client-id}}”,
“client_secret”: “{{user azure-client-secret}}”,
“tenant_id”: “{{user azure-tenant-id}}”,
“subscription_id”: “{{user azure-subscription-id}}”,
“managed_image_resource_group_name”: “{{user azure-resource-group}}”,
“managed_image_name”: “WindowsServer2016-Packer”,
“os_type”: “Windows”,
“image_publisher”: “MicrosoftWindowsServer”,
“image_offer”: “WindowsServer”,
“image_sku”: “2016-Datacenter”,
“communicator”: “winrm”,
“winrm_use_ssl”: true,
“winrm_insecure”: true,
“winrm_timeout”: “5m”,
“winrm_username”: “packer”,
“build_resource_group_name”: “rg-packer”,
“vm_size”: “{{user vm-size}}”
}]}

I have no idea why the VM deployment will be failed. Also, I have tried to restart and redeploy the VM but still can’t resolve this issue.

Somebody can help with this Issue??

Thanks!

Hello.
I have the same problem. Do you have solution or somebody of users here?
I searched information everywhere, I created a lot of pipelines, codes and nothing.

Hi Arek

am not sure but try to setup all using this https://www.nielskok.tech/devops/windows-10-image-series-part-1/