{
"variables": {
"client_id": "",
"client_secret": "",
"tenant_id": "",
"subscription_id": "",
"object_id": "",
"managed_image_resource_group_name": "",
"managed_image_name": "",
"virtual_network_name": "",
"virtual_network_subnet_name": "",
"virtual_network_resource_group_name": "",
"file_source": "",
"packer_ado_pat": ""
},
"builders": [{
"type": "azure-arm",
"client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}",
"tenant_id": "{{user `tenant_id`}}",
"subscription_id": "{{user `subscription_id`}}",
"object_id": "{{user `object_id`}}",
"managed_image_resource_group_name": "{{user `managed_image_resource_group_name`}}",
"managed_image_name": "{{user `managed_image_name`}}",
"virtual_network_name": "{{user `virtual_network_name`}}",
"virtual_network_subnet_name": "{{user `virtual_network_subnet_name`}}",
"virtual_network_resource_group_name": "{{user `virtual_network_resource_group_name`}}",
"os_type": "Windows",
"image_publisher": "MicrosoftWindowsServer",
"image_offer": "WindowsServer",
"image_sku": "2016-Datacenter",
"user_data_file": "{{user `file_source`}}/Bootstrap-Winrm.ps1",
"communicator": "winrm",
"winrm_use_ssl": "true",
"winrm_insecure": "true",
"winrm_timeout": "5m",
"winrm_username": "admin",
"winrm_password": "admin12",
"location": "australiasoutheast",
"vm_size": "Standard_A4m_v2"
}],
"provisioners": [
{
"type": "powershell",
"inline": ["mkdir c:\\Packer"]
},{
"type": "file",
"source": "{{user `file_source`}}",
"destination": "c:\\Packer"
},{
"type": "powershell",
"scripts": "{{user `file_source`}}/Bootstrap-winrm.ps1"
},{
"type": "powershell",
"inline": [
"Add-WindowsFeature Web-Server",
"if( Test-Path $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml ){ rm $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml -Force}",
"& $Env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /quiet /quit"
]
}]
}