Home > Back-end >  "WorkerProcessRestarting. Initialization timed out and host is shutting down" Azure functi
"WorkerProcessRestarting. Initialization timed out and host is shutting down" Azure functi

Time:11-11

"WorkerProcessRestarting. Initialization timed out and host is shutting down" Azure function app run time error for Isolated function, can someone please help.

I created isolated function app in framework 4.8, not able to debug it locally or run it locally. Visual studio doesn't show any error when i try to debug the function app. It keeps processing without hitting the function and not returning any error. Then I tried to deploy it Azure, deployment went fine, when i Try to Run it, get below error in 10 secs "WorkerProcessRestarting. Initialization timed out and host is shutting down"

CodePudding user response:

  • I have reproduced in my environment that VS 2022 is not working with the Azure Functions .NET 4.8 Isolated Project in both debug and running.

  • Tried with the VS Code with the same project, it worked only for Run without debugging.
    enter image description here

  • Debugger Points not hitting the code in VS Code and also in VS 2022:
    enter image description here

enter image description here

  • I have raised the issue in GitHub - Azure Functions dotnet worker Repository and will update the resolution here.

CodePudding user response:

Please refer to the Microsoft sample for Isolated Function App https://github.com/Azure/azure-functions-dotnet-worker/tree/main/samples/FunctionApp

In my case , by mistake was I removed this line .ConfigureFunctionsWorkerDefaults

This is the screenshot of the Program.cs from the url above

This is what I added to Program.cs in my solution and which fixed the issue for me. Program.cs with minimum code to make it work

  • Related