Expose a way to modify the APIM idle timeout or tcp keep alive settings
I have several legacy, long-running, synchronous API operations (10+ mins) that never get a response when I route them through APIM. This is because APIM does not maintain that TCP connection long enough for the backend server to compile the response.
A quick response is to make them asynchronous, which I would have done from the beginning had I designed and developed this product, but as I said this is a legacy application with many existing clients and to change the architecture of this now is not really feasible.
I have worked with Todd Foust from Micorsoft support to determine that the issue is indeed with Azure closing this connection and the ticket has specific details and examples of how to recreate this issue.
Barry Lowrance commented
That probably will not work for anything longer than 4 minutes.
timeout="integer" The amount of time in seconds to wait for the HTTP response headers to be returned by the backend service before a timeout error is raised. Minimum value is 0 seconds. Values greater than 240 seconds may not be honored as the underlying network infrastructure can drop idle connections after this time.
I just found your post looking for an answer to the same question. What I found out is that you need to set a policy as follow:
<forward-request timeout="seconds" />
Just in case you still have the issue