azure-functions-dotnet-worker: Isolated functions with .NET 8 - The gRPC channel uri could not be parsed

Steps to reproduce:

  • using Visual Studio 17.8.1
  • create a new Function app targeting .NET 8 Isolated (i chose an HttpTrigger, but it doesnt really matter)
  • delete the contents of the obj folder, wait a few seconds, and delete the contents again (VS appears to recreate the nested Debug folder so you have to do it twice)
  • F5 debug the app
  • Notice the exception

this might seem like “dont do that” behavior, but this mimics our CI build server that builds in a completely clean environment without VS. when we build and try to run there, we encounter the same error.

investigation shows that configuration["HOST"] and configuration["Functions:Worker:HostEndpoint"] are both null (but configuration["PORT"] is properly set), which causes GetFunctionsHostGrpcUri() in GrpcServiceCollectionExtensions to fail.

note that subsequent runs (when the files in the obj folder exist) all work like normal and the configuration values are present.

@fabiocav @kshyju

image

About this issue

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

Most upvoted comments

Bump.

I’m glad that you have a solution. However, I don’t have the proxy-service to uninstall, and the same problem still persists

Try the following in your ConfigureServices of your test project:

serviceCollection.RemoveAll(typeof(IHostedService));

Very similar issues for me, but using WebApplicationFactory. Runs fine when launched normal ways, but getting exception when hosted by WebApplicationFactory.

I had the same issue when i started the functions runtime from visual studio (F5). Running func host start in the terminal worked without any issues.

Updating Microsoft.Azure.Functions.Worker.Sdk from 1.17.2 to 2.0.0 fixed the issue for me. Now it work from Visual Studio again.

Also getting this issue ‘System.InvalidOperationException: ‘The gRPC channel URI ‘http://:’ could not be parsed.’’ after updating VisualStudio to 17.12.3.

Bumped into this today on an existing project. Turned out to be a compatibility issue with Microsoft.Azure.Functions.Worker.Sdk v1.17.2 and Azure Functions Core Tools v4.0.5907. Updating that package to v1.17.4 (latest) solved it. #sharpenTheSaw

Bump.

I’m glad that you have a solution. However, I don’t have the proxy-service to uninstall, and the same problem still persists

Nevermind. Found the issue. I had the proxy-service cntlm installed and it did not support http/2. After uninstalling it everything worked.

is it fixed?

@briandunnington

this mimics our CI build server that builds in a completely clean environment without VS. when we build and try to run there, we encounter the same error.

How are you running it in your CI environment? Are you doing dotnet run or func host start ?