For me the solution was to upgrade my function from net6.0 to net8.0 rebuild and deploy + setting the environment variable to "dotnet-isolated" instead of "dotnet" in the portal (it ignored my local.settings.json file).