Packer is just a json file that describes what kind of builder to use to build an image, what base image to start with, and some properties on top of that.
Bare Bones file structure:
"provisioners ": [
Builders: Tell Packer how to build the base image. Platform specific. For Azure options are ARM and Azure Image Builder(can provision managed disk on existing VM)
Provisioners: Tools that install software after the initial OS install.
Post-processors: Actions that happen after image is built.
What Packer does under the hood(steps are for a Windows VM. A Linux VM would not require KeyVault):
- Create a resource group.
- Validate and deploy a KeyVault template.
- Validate and deploy a VM template.
- Execute provision - defined by the user; typically shell commands.
- Power off and capture the VM.
- Delete the resource group.
- Delete the temporary VM's OS disk.