Azure function. Failed to connect. Make sure your project is running locally. localhost refused to connect

Thomas Ligon (Office 365) 26 Reputation points
2022-09-06T09:49:54.637+00:00

I'm starting to learn Azure Functions. Yesterday, I ran the first tutorial
https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-python
The function ran locally, then I deployed it and ran it remotely. Today, it still runs remotely, but not locally. The error is
Failed to connect. Make sure your project is running locally.
I tried using the play button to run it and that looks good, but the Workspace Local / Local Project / Functions / <name> and Execute Function Now leads to this error. Copy Function Url and running that in a browser leads to
localhost refused to connect...ERR_CONNECTION_REFUSED
This post describes exactly the same problem
https://stackoverflow.com/questions/70348084/localhost-refused-to-connect-while-running-azure-functions-locally

So how else can I start the function locally?
And, could it be a firewall problem?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,029 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Thomas Ligon (Office 365) 26 Reputation points
    2022-09-07T08:39:47.273+00:00

    It's working today. I'm not sure why, but at least I discovered a button 'start host' in the Terminal window.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.