Packer Azure arm deprovision issue

I could use some help regarding an issue I am having with packer and the azure arm builder. I’m currently trying to use packer to automate my company’s pipeline by creating vhd’s to sell automatically. The issue I am currently having is with the waagent -deprovision+user command. After I run that command, the packer build fails with a: “azure-arm: Error removing temporary script at /tmp/script_7356.sh: ssh: handshake failed: read tcp 192.168.1.3:50105->52.149.163.127:22: wsarecv: An existing connection was forcibly closed by the remote host.” Can anyone offer any insight?

Here is what our current json file looks like:

{
“builders”: [{
“type”: “azure-arm”,
“client_id”: “d0a379eb-0449-4195-b478-94683cb4e218”,
“client_secret”: “1veZ.ocnckD~C4-yfl80Ytg2WoRNqkzi~f”,
“subscription_id”: “c94097f3-f64f-4e70-9058-66a199154f50”,
“os_type”: “Linux”,
“image_url”: “https://awpdiag.blob.core.windows.net/atomicorp-product-images/CentOS-7.9-base.vhd”,
“capture_container_name”: “atomicorp-product-images”,
“capture_name_prefix”: “vhd-packer1-12-29-2020”,
“resource_group_name”: “AWP”,
“storage_account”: “awpdiag”,
“location”: “East US”,
“ssh_wait_timeout”: “10000s”,
“ssh_pty”: “true”,
“ssh_username”: “atomicorp”,
“ssh_password”: “Atomicorp0”,
“vm_size”: “Standard_A2”
}],

“provisioners”: [
{
“type”: “file”,
“source”: “./install.sh”,
“destination”: “/home/atomicorp/install.sh”
},
{
“type”: “file”,
“source”: “./license.sh”,
“destination”: “/home/atomicorp/license.sh”
},
{
“type”: “shell”,
“inline”: [“chmod +x /home/atomicorp/license.sh”, “sudo cp /home/atomicorp/license.sh /var/lib/cloud/scripts/per-once/”]
},
{
“type”: “shell”,
“inline”: [“chmod +x /home/atomicorp/install.sh”, “cd /home/atomicorp/”, “sudo bash /home/atomicorp/install.sh”],
“expect_disconnect”: “true”
},
{
“type”: “shell”,
“execute_command”: “chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh ‘{{ .Path }}’”,
“inline”: ["/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"],
“inline_shebang”: “/bin/sh -x”,
“expect_disconnect”: “true”
}
]

}
Ignore any formatting errors that might arise form a copy/paste.