Azure / azure-functions-dotnet-worker

Azure Functions out-of-process .NET language worker
MIT License
428 stars 182 forks source link

System.InvalidOperationException: 'The gRPC channel URI 'http://:7185' could not be parsed.', After migrating to .NET 8 LTS Isolated Worker model #2622

Open sravanreddy6745 opened 3 months ago

sravanreddy6745 commented 3 months ago

What version of .NET does your existing project use?

.NET 6

What version of .NET are you attempting to target?

.NET 8

Description

After migrating the Function APP from .NET 6 to .NET 8 isolated worker model gets the System.InvalidOperationException: 'The gRPC channel URI 'http://:7185' could not be parsed.' Error

Note: The same changes are working in another function app with service bus queue triggers

Project configuration and dependencies

net8.0 Exe v4 4 PreserveNewest PreserveNewest Never Always

local.settings.json "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "UseDevelopmentStorage=true", "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", }

Host.json:

{
"version": "2.0",
"logging": {
  "applicationInsights": {
    "samplingSettings": {
      "isEnabled": true,
      "excludedTypes": "Request"
    }
  }
}

}

Link to a repository that reproduces the issue

No response

kshyju commented 3 months ago

How are you running it? Are you running func host start or dotnet run ?

sravanreddy6745 commented 3 months ago

I am running it from visual studio 2022, Here is the profile:

{ "profiles": { "DocuSignDocument.FunctionApp": { "commandName": "Project", "commandLineArgs": "--port 7278", "launchBrowser": false } } }

kshyju commented 2 months ago

Looks like you are doing dotnet run. The function app payload should be started with the functions host (runtime). That is why the command to start is func host start. This will start the functions runtime and that will start your function app.

In short, you should not run dotnet run directly on your function app.

GrimRob commented 1 week ago

Had the same problem, it suddenly stopped working. I renamed the csproj file and kept everything else the same. Fixed it.