1

I have an Azure function app with a timer trigger. Inside the app it makes several HTTP requests using the requests library:

requests.get(baseURL, params=params) 

When I debug on my computer it runs without error. Requests take anywhere from 2 to 30 seconds to return. When I deploy in Azure, though, the function will hang after sending some requests and you have to restart it to get it to work again. It never throws an exception and never fails. Just hangs.

The number of requests that Azure successfully completes varies between 2 and 6. The requests are always sent in the same order and always return the same data. There doesn't seem to be any clear pattern for when it hangs. Sometimes it's on requests that return little data, sometimes requests that return more data.

Any ideas??

Mike
  • 11
  • 5
  • Check the memory utilization and logs of the function app. If issue with azure function performance then it change the plan. If your python app check the resources of that – Rahul Shukla Apr 21 '21 at 16:33

1 Answers1

0

For this problem, please check if the function show the logs in time. Please click "Monitor" to check the log but not check logs in "Logs" window because the logs sometimes not show in "Logs" window. By the way, logs in "Monitor" may delay about 5 minutes.

enter image description here

Then please check if your function is timeout. The function in consumption plan set timeout value 5 minutes as default. So if your request several request in function and each request will take tens of seconds, please set functionTimeout with 00:10:00 in "host.json" (the max value of functionTimeout is 10 minutes in consumption plan).

If the function still doesn't work, please check if you request other HttpTrigger function url in your timer trigger function(and the HttpTrigger function is in same function app with your timer trigger function). If so, it may leads to some problem, you can refer to this post which I found similar problem in the past. To solve this problem, just create another function app to separate the timer trigger function and http trigger function.

Hury Shen
  • 14,948
  • 1
  • 9
  • 18