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)
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.Workerpackages to versions lower than 2.0.0, the error I got changed toThe 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
IConfigurationin my Program.cs file, just like the comment above. Removingservices.AddSingleton(config)fixed this issue, and moreover, everything also worked after I upgraded back to the latestMicrosoft.Azure.Functions.Workerpackages.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 ofMicrosoft.Azure.Functions.WorkerandMicrosoft.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 ofMicrosoft.Azure.Functions.Workerand 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 --versionVisual 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.