Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 1.1 KB

File metadata and controls

33 lines (21 loc) · 1.1 KB

Azure Compute Gallery

This example creates the image and then publishes to an Azure Compute Gallery (previously called Shared Image Gallery). Assumes all setup steps are complete

  1. Create the image definition

    Create image definition ubuntu_focal_gen2 in Azure Compute Gallery gallery.

    az sig image-definition create --gallery-name gallery --gallery-image-definition ubuntu_focal_gen2 --publisher "AzureCitadel" --offer Ubuntu --sku 20.04 --os-type linux --hyper-v-generation V2 --resource-group gallery
  2. Run the Packer build

    Fully pathed:

    packer build ~/packer/scenarios/azure_compute_gallery

    Or, if in the directory:

    packer build .

Also creates image ubuntu_focal_gen2 in resource group images.

Publishes to image definition ubuntu_focal_gen2 (v1.0.0) in Azure Compute Gallery gallery in the gallery resource group.

imageId=$(az sig image-definition show --gallery-name gallery --gallery-image-definition ubuntu_focal_gen2 --resource-group gallery --query id --output tsv)