{
  "builders": [{
    "type": "azure-arm",

    "client_id": "<client_id>",
    "client_secret": "<client_secret>",
    "subscription_id": "<subscription_id>",

    "managed_image_name": "<managed_image_name>",
    "managed_image_resource_group_name": "<resource_group>",

    "os_type": "Windows",
    "image_publisher": "MicrosoftWindowsServer",
    "image_offer": "WindowsServer",
    "image_sku": "2019-datacenter-gensecond",

    "shared_image_gallery_destination": {
      "subscription": "<subscription_id>",
      "resource_group": "<resource_group>",
      "gallery_name": "<gallery_name>",
      "image_name": "<image_name>",
      "image_version": "<image_version>",
      "replication_regions": ["southeastasia", "westus3", "eastus"],
      "storage_account_type": "Standard_LRS"
    },

    "build_resource_group_name": "<resource_group>",
    "vm_size": "Standard_D2s_v4",

    "allowed_inbound_ip_addresses": ["<ip_address>"],

    "communicator": "winrm",
    "winrm_use_ssl": true,
    "winrm_insecure": true,
    "winrm_timeout": "10m",
    "winrm_username": "packer",
    "winrm_port": 15986
  }],
  "provisioners": [
    {
      "script": "setup_windows.ps1",
      "type": "powershell",
      "elevated_user": "packer",
      "elevated_password": "{{ build `Password` }}",
      "timeout": "40m",
      "valid_exit_codes": [0, 3010]
    },
    {
      "type": "windows-restart",
      "restart_timeout": "15m"
    },
    {
      "script": "setup_windows_finalize.ps1",
      "type": "powershell",
      "elevated_user": "packer",
      "elevated_password": "{{ build `Password` }}",
      "timeout": "15m"
    }
  ]
}
