hashicorp avatar

Azure Image Builder

Packer template recipes for building Azure managed images and Compute Gallery image versions with the azure-arm builder.

CCM score
69 of 100
skills.sh installs
2.9K
GitHub stars
941
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers two output targets: a basic managed image and an Azure Compute Gallery image with replication regions and storage account type
  • Includes HCL templates with plugin requirements, sensitive variables, timestamped image names, and a shell provisioner, plus service principal and managed identity auth
  • Provides build commands (packer init, packer validate, packer build) and notes that builds take 15 to 45 minutes and incur compute and storage costs
  • Designed for teams creating custom base images for Azure VMs, with troubleshooting for auth failures, immutable gallery versions, and provisioning timeouts

Install

$ npx -y skills add hashicorp/agent-skills --skill azure-image-builder -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Azure Image Builder

Build Azure managed images and Azure Compute Gallery images using Packer's azure-arm builder.

Reference: Azure ARM Builder

Note: Building Azure images incurs costs (compute, storage, data transfer). Builds typically take 15-45 minutes depending on provisioning and OS.

Basic Managed Image

packer {
  required_plugins {
    azure = {
      source  = "github.com/hashicorp/azure"
      version = "~> 2.0"
    }
  }
}

variable "client_id" {
  type      = string
  sensitive = true
}

variable "client_secret" {
  type      = string
  sensitive = true
}

variable "subscription_id" {
  type = string
}

variable "tenant_id" {
  type = string
}

variable "resource_group" {
  type    = string
  default = "packer-images-rg"
}

locals {
  timestamp = regex_replace(timestamp(), "[- TZ:]", "")
}

source "azure-arm" "ubuntu" {
  client_id       = var.client_id
  client_secret   = var.client_secret
  subscription_id = var.subscription_id
  tenant_id       = var.tenant_id

Details

Repository
github.com/hashicorp/agent-skills
Category
DevOps & Cloud
First seen
May 16, 2026

More from hashicorp/agent-skills

All 16

Similar to Azure Image Builder

More DevOps & Cloud