azure-functions-dotnet-worker: Cannot run functions any more in VisualStudio 17.12.1

Description

I have an Azure Functions project that was working.

I updated VisualStudio to get .net9 and now it won’t run any more when I click the ‘play’ button.

It says: System.InvalidOperationException: 'Configuration is missing the 'HostEndpoint' information. Please ensure an entry with the key 'Functions:Worker:HostEndpoint' is present in your configuration.'

Is there a fix for this?

Steps to reproduce

Open previously working Azure Functions solution. Click play.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 21 (1 by maintainers)

Most upvoted comments

Why is this closed when it’s still fucked?

I also hit this issue today when migrating from the .NET 8 in-process model to .NET 8 isolated worker model for Azure Functions. None of the suggested ideas / workarounds above worked for me, however I managed to find a solution thanks to the comment by @WitnessMee: by downgrading all of the Microsoft.Azure.Functions.Worker packages to versions lower than 2.0.0, the error I got changed to The gRPC channel URI 'http://:' could not be parsed.

This led me to find this comment, which ultimately fixed the issue for me: https://github.com/Azure/azure-functions-dotnet-worker/issues/2121#issuecomment-1905832988. Note also https://github.com/Azure/azure-functions-dotnet-worker/issues/2121#issuecomment-1898541957, which shows that this is again related to Functions:Worker:HostEndpoint.

In my case, this issue was caused by dependency injecting an instance of IConfiguration in my Program.cs file, just like the comment above. Removing services.AddSingleton(config) fixed this issue, and moreover, everything also worked after I upgraded back to the latest Microsoft.Azure.Functions.Worker packages.

I’m seeing exactly the same issue

For me the solution was to install Microsoft.Azure.Functions.Worker.Sdk package as top level. I originally had it as a transitive and the solution did not recognize the project as a function project (the solution explorer did not show the project symbol as that azure function lightning). Once I installed the package as top level, it stopped complaining about the host endpoint, I suspect the project did not know to look for the local settings file when it was “of the wrong type”.

same issue here

Started working again here. I have no idea why. So: maybe just leave it and go and do something else for a few months and hope for the best? This is so shit it could be JavaScript.

I had the same Configuration is missing the 'HostEndpoint' issue. None of the suggested solutions worked for me. I fixed it by installing the latest version of Azure Functions Core Tools.

Some more info:

I started testing by creating a new Azure Function App with CLI, Visual Studio Code and Visual Studio.

When I created a project with the CLI func init LocalFunctionProj --worker-runtime dotnet-isolated --target-framework net8.0, it didn’t have that error but it was using an old version of Microsoft.Azure.Functions.Worker and Microsoft.Azure.Functions.Worker.Sdk. When you update those to 2.0 you get the error.

In Visual Studio Code you can use Azure Functions: Create New Project.... and that uses versions 2.0 of Microsoft.Azure.Functions.Worker and you get the error when you start the function.

Create Azure Functions project in Visual Studio did not give any errors when starting it with F5.

So then I found out that Azure Functions Core Tools on my command line had version 4.0.5382 func --version

Visual Studio was using version 4.0.6821. So it’s not using PATH but using a func that is included with Visual Studio. I don’t know where it is.

The easiest way to fix it is to download the latest Azure Functions Core Tools version here: https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=windows%2Cisolated-process%2Cnode-v4%2Cpython-v2%2Chttp-trigger%2Ccontainer-apps&pivots=programming-language-csharp#install-the-azure-functions-core-tools

Everything was working for me after that.

I’m seeing this issue once deployed to Azure. It runs locally, however.