As mentioned in the introduction, to create a VM image, Packer is based on a file (template) that is in JSON format. We will first see the structure and composition of this JSON template, and then we will put into practice how to create a template that will create a VM image in Azure.
Creating Packer templates for Azure VMs with scripts
The structure of the Packer template
The Packer JSON template is composed of several main sections such as builders, provisioners, and variables. The structure of a template is as follows:
{
"variables": {
// list of variables
...
},
"builders": [
{
//builders properties
...
}
],
"provisioners": [
...