Duc Dang
Duc Dang

Reputation: 23

Status: 503 Service Unavailable Azure Function

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.

Upvotes: 0

Views: 13365

Answers (1)

Sushen Vashikar
Sushen Vashikar

Reputation: 31

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"
}

Upvotes: 3

Related Questions