Custom image creation by packer in the compute gallery for virtual machines in the Azure

82 Views Asked by At

I have gone through this document, but there it is given with managed image details

where to give computer gallery details in the template? where to give source image (existing image) and destination image (need to be created) details in template?

for example: in the given JSON template, I am not sure where to pass the values of compute gallery that includes: source gallery name, source VM image definition and VM version and then same destination details VM version details. I am going to create new image in the same gallery. For example from source gallery I take 1.0.0 image and then after packer does it steps I should see 1.0.2 in the same gallery

enter image description here

1

There are 1 best solutions below

0
Marcin Słowikowski On

It's better to check Packer and azure plugin documentation instead of Microsoft docs about Packer

This is example how you can define base image from Azure Compute Gallery in JSON format:

"shared_image_gallery": {
    "subscription": "00000000-0000-0000-0000-00000000000",
    "resource_group": "ResourceGroup",
    "gallery_name": "GalleryName",
    "image_name": "ImageName",
    "image_version": "1.0.0",
}

https://developer.hashicorp.com/packer/integrations/hashicorp/azure/latest/components/builder/arm#shared-image-gallery