0

I have azure function which runs fine in one system, but failing in other. Below error gets logged

[2024-02-15T15:55:27.214Z] Exceeded language worker restart retry count for runtime:dotnet-isolated. Shutting down and proactively recycling the Functions Host to recover
[2024-02-15T15:56:27.081Z] Starting worker process failed
[2024-02-15T15:56:27.087Z] Microsoft.Azure.WebJobs.Script.Grpc: The operation has timed out.
[2024-02-15T15:56:27.110Z] Failed to start language worker process for runtime: (null). workerId:72524eee-6ff3-4410-a72e-a8be7a5ff8a1
[2024-02-15T15:56:27.198Z] You must install or update .NET to run this application.
[2024-02-15T15:56:27.201Z] App: C:\Users\veeduji\source\repos\Flooid\src\AzureFunctions\Flooid\DepositChargeProcessor\bin\Debug\net8.0\DepositChargeProcessor.dll
[2024-02-15T15:56:27.204Z] Architecture: x64
[2024-02-15T15:56:27.207Z] Framework: 'Microsoft.NETCore.App', version '8.0.1' (x64)
[2024-02-15T15:56:27.213Z] .NET location: C:\Program Files\dotnet\
[2024-02-15T15:56:27.216Z] The following frameworks were found:
[2024-02-15T15:56:27.221Z]   6.0.25 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
[2024-02-15T15:56:27.224Z]   7.0.14 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
[2024-02-15T15:56:27.226Z]   8.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
[2024-02-15T15:56:27.229Z] Learn more:
[2024-02-15T15:56:27.234Z]
https://aka.ms/dotnet/app-launch-failed
[2024-02-15T15:56:27.236Z] To install missing framework, download:
[2024-02-15T15:56:27.238Z]
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.1&arch=x64&rid=win-x64&os=win10
[2024-02-15T15:56:27.256Z] Host startup operation has been canceled
[2024-02-15T15:56:27.300Z] Failed to stop host instance '3a7db5ec-57d7-4806-9128-8d89abe3dae0'.
[2024-02-15T15:56:27.302Z] Microsoft.Azure.WebJobs.Host: The host has not yet started.
Value cannot be null. (Parameter 'provider')

In system where i can run function has runtime 8.0.1, but system which fails obviously has 8.0.0 My doubt is, is Azure function runtime gets supported by 8.0.1? Can i make it run with 8.0.0? Also a newbie here, please be kind.

1
  • There is no version specifically 8.0.1 in the Official site list - dotnet.microsoft.com/en-us/download/dotnet/8.0 Tell us which specific version from the list given in the site, you installed and trying with? Commented Feb 16, 2024 at 12:37

3 Answers 3

0

In addition to my comment:-

I tried a sample code using .NET 8.0 and ran it successfully locally and on the Azure Portal.

Code :

using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;

namespace FunctionApp100
{
    public class Function1
    {
        private readonly ILogger<Function1> _logger;

        public Function1(ILogger<Function1> logger)
        {
            _logger = logger;
        }

        [Function("Function1")]
        public IActionResult Run([HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequest req)
        {
            _logger.LogInformation("C# HTTP trigger function processed a request.");
            return new OkObjectResult("Welcome to Azure Functions!");
        }
    }
}

Output :

It ran successfully, as shown below.


Azure Functions Core Tools
Core Tools Version:       4.0.5504 Commit hash: N/A +f829589bca9exxxxxxxxxxxxx (64-bit)
Function Runtime Version: 4.28.3.21820

[2024-02-16T12:35:26.756Z] Found C:\Users\xxxxxxxx\source\repos\FunctionApp100\FunctionApp100\FunctionApp100.csproj. Using for user secrets file configuration.
[2024-02-16T12:35:32.181Z] Azure Functions .NET Worker (PID: 30948) initialized in debug mode. Waiting for debugger to attach...
[2024-02-16T12:35:32.256Z] Worker process started and initialized.

Functions:

        Function1: [GET,POST] http://localhost:7107/api/Function1

For detailed output, run func with --verbose flag.
[2024-02-16T12:35:37.556Z] Host lock lease acquired by instance ID '000000000xxxxxxxxxxxxxx'.
[2024-02-16T12:36:18.136Z] Executing 'Functions.Function1' (Reason='This function was programmatically called via the host APIs.', Id=dcaa580xxxxxxxxxxx)
[2024-02-16T12:36:18.651Z] C# HTTP trigger function processed a request.
[2024-02-16T12:36:18.652Z] Executing OkObjectResult, writing value of type 'System.String'.
[2024-02-16T12:36:18.804Z] Executed 'Functions.Function1' (Succeeded, Id=dcaa580xxxxxxxxxxx, Duration=726ms)

enter image description here

I received the following output in the browser using the get request URL mentioned above.

http://localhost:7107/api/Function1

Welcome to Azure Functions!

enter image description here

Then, I published my project to the function app, as shown below.

enter image description here

Azure Portal :

It ran successfully in the function app, as shown below.

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

As i mentioned, I'm trying from my system. Please read through my issue. I never mentioned I got issue with deploying to Azure. It works fine there.
0

I had this issue, because my Functions were running on .NET 8, but I had removed all runtimes locally, except .NET 9.

When I upgraded the Azure Functions to work with .NET 9, I was able to run them.

Comments

-1

I was able to make it work by installing runtime version 8.0.1

3 Comments

Which property did you use?
Where did you install it? Which property did you use? Please elaborate on your answer.
What does this mean exactly

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.