hashicorp/agent-skills
Overview
This skill builds Azure managed images and Azure Compute Gallery images using Packer's azure-arm builder. It automates VM provisioning, software installation, and image capture so you get repeatable, versioned VM images for Azure. Use it to produce custom Linux or Windows images optimized for deployment at scale.
How this skill works
The skill configures an azure-arm Packer source with Azure credentials, base image details, VM size, and location. It runs a temporary build VM, applies provisioners (shell, scripts, or configuration management), then either creates a managed image or publishes a version into an Azure Compute Gallery. Authentication uses a Service Principal or Azure CLI/Managed Identity.
When to use it
- Create standardized golden images for production or testing environments.
- Publish versioned images to Azure Compute Gallery for regional replication and scale.
- Automate OS hardening, software installs, and configuration before VM deployment.
- Replace manual VM cloning with repeatable, automated image builds.
- Integrate image creation into CI/CD pipelines for immutable infrastructure.
Best practices
- Use a Service Principal with least-privilege roles or managed identity to limit scope.
- Keep image versions immutable; include timestamp or build number in the version string.
- Minimize the number of provisioner steps in the image; offload ephemeral setup to startup scripts where possible.
- Use shared image gallery for regional replication and to manage image lifecycle.
- Monitor build costs and cleanup temporary resources to avoid unexpected charges.
Example use cases
- Build a hardened Ubuntu image with corporate packages and security patches applied.
- Publish a webserver image to Compute Gallery with versions per release date for blue/green deployments.
- Automate Windows Server image creation with preinstalled roles and configuration.
- Integrate Packer image builds into CI pipelines to produce artifact versions per commit.
FAQ
Use a Service Principal (ARM_CLIENT_* env vars) or enable Azure CLI/managed identity by setting use_azure_cli_auth. Ensure the identity has appropriate Contributor or specific resource permissions.
How do I avoid image version conflicts in Compute Gallery?
Image versions are immutable. Use unique version strings (date + build number) or increment versions per build to prevent collisions.
10 skills
This skill helps you build Azure managed images and Compute Gallery assets using Packer, streamlining custom VM image creation for Azure deployments.
This skill helps you build custom AMIs with Packer's amazon-ebs, streamlining AWS image creation and provisioning.
This skill guides building Windows images with Packer using WinRM and PowerShell to streamline AMIs, Azure images, and VMware templates.
This skill helps you design and implement Terraform Provider resources and data sources using the Plugin Framework for robust CRUD, state, and testing.
This skill helps you generate Terraform configurations following HashiCorp style, ensuring proper structure, naming, and security best practices.
This skill guides you to run Terraform provider acceptance tests using TestAcc prefix with go test -run and TF_ACC, plus debugging steps.
This skill refactors monolithic Terraform configurations into reusable modules with clear interfaces, encapsulation, versioning, and migration guidance.
This skill helps you ensure Azure Verified Modules compliance by applying AVM Terraform, provider, and documentation standards across modules.
This skill helps you create, validate, and manage Terraform Stacks configurations across environments and regions using .tfcomponent.hcl and .tfdeploy.hcl.
This skill scaffolds a new Terraform provider project using Plugin Framework, creating workspace, initializing modules, and validating with tests.