MikeDouglasDev
MikeDouglasDev

Reputation: 1351

Azure Function App in PowerShell generating host threshold exceeded errors

We just started getting this error yesterday but haven't changed anything in our app. Any ideas? If we restart the function app, it will run for a short time and then start giving us this error again. The function app is in PowerShell.

Host Error: Microsoft.Azure.WebJobs.Script: Host thresholds exceeded: [Connections]

Upvotes: 0

Views: 1126

Answers (2)

MikeDouglasDev
MikeDouglasDev

Reputation: 1351

I'm not sure if it is the above change that caused this but it is a coding issue on my side that is now being handled correctly by Azure Functions. I created this small repo and after I commented out the close, I received the error. My real code is more complex but clearly somewhere I'm not closing it out.

$Ports = @(21,22,23,53,69,71,80,98,110,139,111,389,443,445,1080,1433,2001,2049,3001,3128,5222,6667,6868,7777,7878,8080,1521,3306,3389,5801,5900,5555,5901)

for($i = 1; $i -le $ports.Count;$i++) {
            $port = $Ports[($i-1)]
$client = New-Object System.Net.Sockets.TcpClient
$beginConnect = $client.BeginConnect("123.123.123.123",$port,$null,$null)
#$client.Close();
}

Upvotes: 1

ahmelsayed
ahmelsayed

Reputation: 7402

This was recently added in the runtime to track running out of available connections on the VM

https://github.com/Azure/azure-webjobs-sdk-script/pull/2063

It should point to you running out of available connections. It could be wrong or correct, but I can't tell without looking at your functions themselves.

If you would like to discuss it, then you probably should use the repo above

Upvotes: 2

Related Questions