0
votes

i have the following code in my azure function with 5 minutes manual timeout.

Function Code

when i run the above function in azure, i see the function creates a new instance after 3 minutes.(check the below image) Logs from azure both the instances completes successfully ,but returns Status: 504 Gateway Timeout which in turn fails my function execution. i have hosted the function in App Service Plan, and also increased the timeout in host.json file to 10 minutes

"functionTimeout": "00:10:00"
1
How is the trigger defined?Mikhail Shilkov
i have used http trigger for the function.ABaig
@ABaig as mag_zbc suggests, please do not post bitmaps of code and function output. This makes it much harder to work with. e.g. no easy way to grab the invocation IDs without manually copying them.David Ebbo
Also, clarify how you are invoking the function, and what makes you believe that the function is calling itself.David Ebbo
Do not post code as images, ever. Please edit your question, remove the images and add the code as text. Why may I not upload images of code on SO when asking a question?Modus Tollens

1 Answers

0
votes

Several questions in here:

  1. Timeouts - The function timeout in host.json applies to the underlying function runtime; not the http pipeline. You should not have an http function running longer than a minute. The http calls will timeout independently of the runtime (as you see with the 504). However, you could use that timeout for a long-running (ie, 60 minute on appservice plan) queue trigger. If you need a long-running function, the http call could queue a message for a queue trigger, or you could use the Durable Function support.

  2. Why is it invoking again? The simplest interpretation here is that your function is just receiving a second http request message. Do you have evidence that's not the case? You could bind to the HttpRequestMessage and log additional http request properties to track this down.