Where we define source image and destination image details while automating the image creation using packer

Varma 1,495 Reputation points
2024-02-07T06:18:31.64+00:00

Where we create a source image and destination image version details to be created in the following JSON file mentioning the following document? https://learn.microsoft.com/en-us/azure/virtual-machines/windows/build-image-with-packer FYI: I have gallery where image are exist COuld you please provide me updated template where I should be able to provde source image details and destination image details. I am planning to do with JSON.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,013 questions
{count} votes

Accepted answer
  1. Martin Therkelsen 1,410 Reputation points MVP
    2024-02-08T20:53:40.17+00:00

    You can use this JSON to deploy and image from Azure Compute Gallery and also capture it to Azure Compute Gallery.

    {
        "builders": [
            {
                "type": "azure-arm",
                "client_id": "",
                "client_secret": "",
                "tenant_id": "",
                "subscription_id": "",
                "shared_image_gallery": {
                    "subscription": "",
                    "resource_group": "rg-avd-images",
                    "gallery_name": "gal_avd",
                    "image_name": "avd_w11",
                    "image_version": "1.0.0"
                },
                "shared_image_gallery_destination": {
                    "subscription": "",
                    "resource_group": "rg-avd-images",
                    "gallery_name": "gal_avd",
                    "image_name": "avd_w11_new",
                    "image_version": "1.0.0",
                    "replication_regions": ["WestEurope"],
                    "storage_account_type": "Standard_LRS"
                },
                "build_resource_group_name": "myPackerGroup",
                "os_type": "Windows",
                "vm_size": "Standard_D4s_v5",
                "winrm_insecure": true,
                "winrm_timeout": "5m",
                "winrm_use_ssl": true,
                "winrm_username": "packer"
            }
        ]    
    }
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.