2

I have an Azure function-app which is running in App Service plan. I do have long running processes which makes the host to go down (host gets shut-downed).

I have tried 2 approaches.

  1. Changed the functionTimeout value in host.json to "02:00:00" - No luck
  2. As per the below link and tried with functionTimeout as -1. Even here no luck. Still the function app host downs after 30 minutes.

https://learn.microsoft.com/en-us/azure/azure-functions/functions-host-json

Below is my host.json file content

{
  "version": "2.0",
  "functionTimeout": -1,
  "queues": {
    "maxPollingInterval": 2000,
    "visibilityTimeout": "00:00:30",
    "maxDequeueCount": 10,
    "batchSize": 10
  },
  "logger": {
    "categoryFilter": {
      "categoryLevels": {
        "Function": "Verbose"
      }
    }
  },
  "logging": {
    "logLevel": {
      "namespace": "Information"
    }
  }
}

I expect function-app host timeout should be increased to 2 hours from its default 30 minutes.

2 Answers2

0

All logging settings now live under "logging". This means that the "tracing" and "logger" have been removed.

{
    "version": "2.0",
    "functionTimeout": "02:00:00",
    "logging": {
        "logLevel": {
            "namespace": "Information"
        }
    },
    "extensions": {
        "queues": {
        "maxPollingInterval": 2000,
        "visibilityTimeout": "00:00:30",
        "maxDequeueCount": 10,
        "batchSize": 10
    }
}

Even with Always On enabled, the execution timeout for individual functions is controlled by the functionTimeout setting in the host.json project file.

For longer processing times, consider using the Durable Functions async pattern or defer the actual work and return an immediate response.

Joey Cai
  • 18,968
  • 1
  • 20
  • 30
0

Not sure why this question has not been answered yet. I came across same situation where the app was ignoring values in host.json file. Below solution worked for me(Azure Function App v2+):

  1. Go to respective Function App.
  2. Click on Configuration tab under Settings section from left hand side panel.(PFA)
  3. Change the value of AzureFunctionsJobHost__functionTimeout(PFA)

Please not that there are some articles suggesting to update the functionTimeout value in local.settings.json, I tried but it doesn't work locally. But this solution works on server.

enter image description here

enter image description here

Shardul
  • 309
  • 1
  • 3
  • 17