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
objfolder, wait a few seconds, and delete the contents again (VS appears to recreate the nestedDebugfolder 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.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 30 (6 by maintainers)
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 startin the terminal worked without any issues.Updating
Microsoft.Azure.Functions.Worker.Sdkfrom1.17.2to2.0.0fixed 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?
@mikkovor See https://github.com/Azure/azure-functions-dotnet-worker/issues/2121#issuecomment-1847281008
@briandunnington
How are you running it in your CI environment? Are you doing
dotnet runorfunc host start?