I have a simple powershell orchestrator which just reads a text file and sends parts of the list to be processed on functionA.
$payLoad = Get-Content tracks.txt
[int]$itemCount = $payLoad.Count / 50
for ($i = 0; $i -le $payLoad.Count; $i++) {
$payloadList += $payLoad[$i]
if ($payloadList.Count -eq $itemCount) {
Write-Host $payloadList
Start-ThreadJob -Argumentlist $payloadList -Scriptblock {
# Here I am filling urls etc.
Invoke-RestMethod @params
}
$payloadList = @()
}
}
I have close to 1000 items in the list but only roughly 200 is always processed. I can see from the orchestrator logs that the powershell threadjob is created for all but somewhere big portion of my jobs disappear. Does Azure functions not support this way of invoking functions or where am I going wrong?