API gate way time out Issue

Revathi Subramaniam 21 Reputation points
2020-10-23T07:24:17.087+00:00

Hi,

When run the logic app using API through postman, the gateway has timed out and says 504 gateway timeout.

But logic app is running after getting response in postman.

Could you please help on this how to extend time out in API gateway.
or
how to manage Async using polling?

if we use Async polling then also it will give time out due to API gate way.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,175 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,211 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Mike Urnun 9,821 Reputation points Microsoft Employee
    2020-10-26T22:01:59.577+00:00

    Hello @Revathi Subramaniam

    For workflows that take longer, you'll definitely want to use the async polling pattern. This pattern is built into the Response action of the Request connector and can be turned on in the Settings of the connector:

    35181-image.png

    35143-image.png

    Once Async Polling is enabled, whenever a request comes through, your Logic App will immediately return a successful 202 response back to your Postman client with a Location header containing a URL endpoint that your client can poll to check if the workflow has completed or not:

    35123-image.png

    If you invoke the URL in the Location header in a separate request to check the status of the workflow, you'll notice a status property in the response payload:

    35172-image.png

    In the example, I have a workflow with an HTTP trigger that takes 5mins to complete the workflow. I'm using the Delay action to mimic a long-running job:

    35191-image.png

    After the workflow completes at 5mins mark, Response action returns a successful 200 response and the status should set to completed at the URL endpoint in the Location header.


  2. Mike Urnun 9,821 Reputation points Microsoft Employee
    2020-10-30T19:04:28.547+00:00

    Hey @Revathi Subramaniam

    Could you clarify the below?

    But i am not able to see the location field in logic app trigger body output header section . Hence how i can get Location url in logic app.

    You shouldn't need or expect the Location header in the trigger or the response output. URL in the Location header is only made available to the receiving client application (which in this case is a Postman), but typically, the client application is another Webapp, Logic app, or just another application that invokes your trigger and polls the given URL in the Location header of the response to check the status of the long-running job.

    The following documentations might be a good read:


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.