I want to have a schedule running an Invantive Cloud App made with assistance from Invantive to synchronize Visma.net data to Azure SQL. Firstly, I have a curl
that works, but I do not have a server to schedule it on. Thus I was recommended Azure Automation and runbooks, which is a cloud PowerShell in essence.
The Curl working is:
curl --user <username:password> https://<invantive cloud-app url>
I then set up the following powershell:
$username = "username"
$password = "password" | ConvertTo-SecureString -asPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($username,$password)
$res = Invoke-WebRequest -Uri "<URL>" -Credential $cred -UseBasicParsing
This works fine for small data transfers, but when I do the larger tables, the script runs for about 15 minutes and then stops with the following error message:
Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a receive. At line:4 char:8 + $res = Invoke-WebRequest -Uri "https://app-online.cloud/apps/4e6378a4 … + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Any suggestions to what can be wrong?