Search code examples
c#jsonazureazure-functionssession-timeout

functionTimeout not working in local.settings.json Azure Function in my local machine


I'm developing an Azure Function in my local machine using Visual Studio 2022 Community and it has been impossible to me to change the timeout of the function.

I have tried "functionTimeout": "-1" and "functionTimeout": "23:00:00" but they are ignored in my local machine.

I can't upload the Function to Azure because we do not want to spend money an all the prove of concept is in my local machine.

This is my local.settings.json:

    {
      "IsEncrypted": false,
      "functionTimeout": "-1",
      "Values": {
        "AzureWebJobsStorage": "",
        "FUNCTIONS_WORKER_RUNTIME": "dotnet",
        "containerName": "someText",
        "containerNameSaving": "someText",
        "containerFileNameSaving": "someText",
        "storageConnectionString": "someText",
        "phi3Model": "someText",
        "phi3Server": "someText",
        "phi3Temperature": someValue,
        "phi3Num_ctx": someValue
      }
    }

Solution

  • I have found the issue, you have to set the time out in the file host.json not in local.settings.json.

    I have tried with "functionTimeout": "00:00:01" and "functionTimeout": "00:00:10" and worked properly.

    I have test it to, and I have already pass the 30 min default time out.

    {
      "version": "2.0",
      "functionTimeout": "23:00:00",
      "logging": {
        "applicationInsights": {
          "samplingSettings": {
            "isEnabled": true,
            "excludedTypes": "Request"
          },
          "enableLiveMetricsFilters": true
        }
      }
    }