Parsing error on Windows, works on Linux

I’ve been using packer the past few days to try and deploy a VM to Azure and have found what seems to be a bug. When using a Azure Windows Agent my template returns the following error.

“Unexpected token a in JSON at position XXX.”

When I use an Ubuntu agent the parsing completes as expected. Does anyone have any idea what is going on here? I am using the most recent version of Packer, 1.7.0. For what its worth, here is my template.

"variables": {
  "ADOServicePrincipalAppId": "",
  "ADOServicePrincipalSecret": "",
  "TenantId": "",
  "SubscriptionId": "",

  "ImageDestRG": "",    
  "TempResourceGroup": "",

  "VirtualNetwork": "",
  "VirtualNetworkRG": "",
  "Subnet": "",

  "Location": "",
  "VMSize": "",

  "WorkingDirectory": "",

  "StorageAccountInstallersName": "",
  "StorageAccountInstallersKey": "",
  "StorageAccountInstallersPath": "",

"builders": [
    "type": "azure-arm",
    "client_id": "{{user `ADOServicePrincipalAppId`}}",
    "client_secret": "{{user `ADOServicePrincipalSecret`}}",
    "tenant_id": "{{user `TenantId`}}",
    "subscription_id": "{{user `SubscriptionId`}}",

    "os_type": "Windows",
    "managed_image_name": "ElysiaComputeAgentScaleSetImg",
    "managed_image_resource_group_name": "{{user `ImageDestRG`}}",
    "build_resource_group_name": "{{user `TempResourceGroup`}}",

    "image_publisher": "{{user `ImagePublisher`}}",
    "image_offer": "{{user `ImageOffer`}}",
    "image_sku": "{{user `ImageSku`}}",
    "communicator": "winrm",
    "winrm_use_ssl": "true",
    "winrm_insecure": "true",
    "winrm_timeout": "30m",
    "winrm_username": "packeruser",
    "winrm_password": "packerpassword",
    "temp_compute_name": "tempname",

    "virtual_network_name": "{{user `VirtualNetwork`}}",
    "virtual_network_subnet_name": "{{user `Subnet`}}",
    "virtual_network_resource_group_name": "{{user `VirtualNetworkRG`}}",
    "private_virtual_network_with_public_ip": "False",
    "azure_tags": {
      "Image Publisher": "{{user `ImagePublisher`}}",
      "Image Offer": "{{user `ImageOffer`}}",
      "Image SKU": "{{user `ImageSku`}}"

    "vm_size": "{{user `VMSize`}}",

"provisioners": [
    "type": "powershell",
    "inline": [

        "Import-Module -Name Smbshare -Force -Scope Local",
        "$Usr='AzureAD\\'+\"{{user `StorageAccountInstallersName`}}\"",
        "New-SmbMapping -LocalPath Z: -RemotePath \"{{user `StorageAccountInstallersPath`}}\" -Username \"$Usr\" -Password \"{{user `StorageAccountInstallersKey`}}\"",
        "Write-Host \"'Z:' drive mapped\""
    "type": "powershell",
    "script": "{{user `WorkingDirectory`}}/path/to/file/sysprep.ps1"


Thanks for your help.

Did you tried a newer version of Packer.
How does the StorageAccountInstallersPath variable filled look?