An Azure service that provides an event-driven serverless compute platform.
@Mustaq Tailor Thanks for reaching out. It's possible that the "An operation was attempted on a nonexistent network connection" error message could occur if APIM times out while waiting for a response from the Function App.
When APIM sends a request to the Function App, it establishes a network connection to the Function App and waits for a response. If the Function App takes too long to respond, APIM may time out and close the network connection. If the Function App then tries to send a response over the closed connection, it may trigger the "nonexistent network connection" error message.
You can check the logs for both APIM and the Function App to see if there are any errors or exceptions that may be related to the timeout issue.
In case if you have validated this and still facing the issue then I will suggest you review the Diagnose and solve problems blade on your Function app to validate if there are any insights that provide more details on your error/exception/issue and mitigation steps to resolve the issue.
if the above doesn't help, then I can help to review your function logs/metrics to at my end to assist you further.
Feel free to get back to me if you have any queries or concerns.