0
votes

I have my Azure Function in Azure.My function have 3 parameter to run.When I run in local everything's alright.But when I deploy to Azure.My Function run about 10 minutes,then azure got status: 503 Service Unavailable and it auto run again(I don't impact anything).The first time still ran parallel to the second. My function run in App Service Plan,V1,I use HttpTrigger. Any ideal can help me?Thanks for reading.

1
Have you got any logs in portal? Or go to kudu https://<functionappname>.scm.azurewebsites.net/DebugConsole and navigate to D:\home\LogFiles\Application\Functions\Host> for host logs.Jerry Liu
It don't show any log when it got 503,it just call itself againDuc Dang
HttpTrigger should return response in 230 seconds in Azure site, see whether this thread fits your situation.Jerry Liu
tks you for helpDuc Dang

1 Answers

2
votes

Seems like your function takes more than 4 minutes to return an HTTP response. As mentioned in the documentation, 230 seconds is the maximum amount of time that an HTTP triggered function can take to respond to a request. Please refer to this.

For longer processing times, use Azure Durable Functions async pattern. Refer to this link.

Also, setting the appropriate value to the parameter 'functionTimeout' of the 'host.json' file can also avoid autorun of the azure function. Please look at the sample host.json file format below where the parameter 'functionTimeout' is set to 55 minutes.

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[2.*, 3.0.0)"
  },
  "functionTimeout": "00:55:00"
}