Search code examples
azureazure-functions

Azure funcion app won't start locally after upgrade to .NET8


I got an Azure function app implemented using C# .NET8 (Isolated). Before that, it was using .NET6 and I had no issues with just running the solution from VS and start debugging. Now with .NET8, VS is starting the function, but it then simply get stuck at some point with the last output lines of:

FUNCTIONS_WORKER_RUNTIME=dotnet. Will shutdown all the worker channels that started in placeholder mode Host lock lease acquired by instance ID '000000000000000000000000CDF5655B'.

When it happens, VS itself is stuck with a modal window saying "Launching local Functions process..." which never finishes. My "FunctionsExtensionVesion" is set to "~4".

I've tried reinstalling the latest version of the Azure function core tools from learn.microsoft.com, but that didn't help.

What else can be done?


Solution

  • FUNCTIONS_WORKER_RUNTIME=dotnet. Will shutdown all the worker channels that started in placeholder mode Host lock lease acquired by instance ID '000000000000000000000000CDF5655B'.

    This indicates that FUNCTIONS_WORKER_RUNTIME is still set to dotnet. But according to the details provided, you are upgrading the .NET 6.0 function to .NET 8.0 Isolated.

    To resolve the issue, you need to update the FUNCTIONS_WORKER_RUNTIME to dotnet-isolated in local.settings.json.

    local.settings.json:

    {
        "IsEncrypted": false,
        "Values": {
            "AzureWebJobsStorage": "UseDevelopmentStorage=true",
            "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated"
        }
    }
    
    • Rebuild the function project.