azure-functions-dotnet-worker: Azure Function host not starting after upgrade to .NET 8 Isolated

I have started the migration of our Azure Functions from .NET 7 Isolated (running OK for several months) to .NET 8 Isolated.

After updating all the packages and making sure it runs locally, I deployed to our existing instance on Azure using the Visual Studio Publish wizard using exactly the same settings that were working for .NET 7 Isolated. image

However, the Function app is not available: image

This instance is running in a Consumption Plan, UK South region. I suspect this issue won’t affect our product Elastic Plan but I can’t risk a deployment.

I have set ‘fileLoggingMode’ to ‘always’ but there are no new logs in C:\home\LogFiles\Application\Functions\Host or C:\home\LogFiles\Application\Functions\Function.

The eventlog.xml has several entries alternating between EventID 2276 and 2294, all with the same BinaryData 02000780: image

According to kb.eventtracker.com:

2294 is recorded when: Each application pool has a managedRuntimeVersion attribute that contains the version of the common language runtime (CLR) that the application pool preloads. If the value in the attribute does not match the installed runtime, the worker process may fail to load

2276 is recorded when: This event is logged when the worker process failed to initialize correctly. and the BinaryData should provide more details via err.exe.

err.exe says that error 02000780 is The file cannot be accessed by the system: image

All of the above points to some issue with the App Service / Function host.

There are other people reporting similar issues: #2075. Something similar seems to have happened before during previous releases of .NET 8: #1644

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 30 (5 by maintainers)

Most upvoted comments

going to reference my comment from this thread here as i think it might help some people:-

https://github.com/Azure/azure-functions-dotnet-worker/issues/2070

"Just thought i would help people out a bit.

I have been hitting a similar issue all day where after an Isolated worker, .net 8 upgrade to our azure functions, they would not longer work/show in Azure. I could see that when deploying it manually via the IDE, it worked fine in Azure but failed/never loaded when doing a normal CICD deployment.

I have now eventually tracked this issue down and thought i would share in case it helps anyone else.

So when moving to the isolated worker process for .NET 8, it turns out they have changed how the release files are now compiled and distributed. They now create a folder named “.azurefunctions” which holds the connecting information for the deployed azure functions upon a release build. Most compression libraries unless strictly supplied, actually exclude folders with “.” starting for their name as its generally reserved for hidden directories. This is most probably why a lot of peoples CICDs are now deploying broken azure functions as the majority of people are doing zip deployments in their CICD.

For reference the original deployment structure was a folder for each azure function with its name with no “.” at the start of it, so upon people upgrading to the new version, their CICDs will be excluding the folders by default from the deployment to Azure.

If you go into “Advance Tools” and navigate to the wwwroot folder you will be able to confirm if this is an issue for yourself as the folder will be missing."

@kshyju Can you please reopen this issue, it’s not completed at all and still not working

The initial issue stemmed from a delay in deploying .NET runtime bits in certain regions. If you’re still facing problems with .NET8, please open a new issue on this repository with relevant details, and we’ll investigate further

@karolis1994 To fix that you can roll back the sevicebus extension version to 5.13.0.

We are also experiencing 503 errors with functions deployed in Europe North and West. We are deploying container images. I’ve tried creating a new function app in Azure and a new function project in Visual Studio with the app still showing 503. We are using mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0 as our base image. We use the Azure Functions for container task in our Azure DevOps release pipeline to deploy. We are using the latest Microsoft.Azure.Functions.Worker and Microsoft.Azure.Functions.Worker.Sdk packages.

@DanRogers99 Are you only experiencing the issue in those regions? It’s possible that NET8 rollout has not been completed to those regions you mentioned. Please follow https://github.com/Azure/azure-functions-dotnet-worker/issues/2075 to track which regions are still in-progress.

I’m happy to report that things are working OK for me since yesterday, both on Consumption Plan and Elastic. UK South.

Thanks for adding this piece of evidence, @abenteuerzeit . I’m hoping someone from the team sees this and provides a solution. I’m still stuck in .NET 7 which wouldn’t be such a big deal if I didn’t have a Blazor project that does benefit a lot from moving to .NET 8 but is currently stuck because of this issue.

I observed that deploying a function app using .NET 8 (LTS) Isolated (Early Access) in the UK South region led to an internal server error. However, when we switched the target to .NET 7, the service operated as expected, and the default page loaded successfully. Further tests using Visual Studio 2022 and VS Code indicated issues with .NET 8 in the UK South region.

When I tried deploying the same setup in the US East region, it worked correctly, indicating that the issue might be region-specific.