I have a Function App written in Powershell, that is being triggered by Logic Apps and that sends back to Logic Apps following response:
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = [HttpStatusCode]::OK
Body = [ordered]@{
"Subject" = "$scriptName executed successfully."
"MailTemplate" = "$template"
} | ConvertTo-Json
})
The problem is that this Function App can sometimes even run up to 10 minutes, and in that case it returns an error. I saw that a Webhook activity can be implemented in order to resolve the issue, but in that case the Function App would have to return a response twice - once at the very beginning with a status code 200, and once at the very end - which is not possible using the above method, since you can have only one OutputBinding in the code. How can this be resolved? I also tried adding an "until" loop into my Logic App, but this still gives me the same error.