Port 7071 is unavailable. Close the process using that port, or specify another port using --port [-p]

Port 7071 is unavailable. Close the process using that port, or specify another port using --port [-p]

Raymond Tang Raymond Tang 0 4886 3.52 index 9/10/2021

When developing Azure Functions with .NET 5 in Visual Studio 2019, the following error pops out:

2021091015601-image.png

Port 7071 is unavailable. Close the process using that port, or specify another port using --port [-p].

The cause of the error is obvious: the default port is unavailable either because of firewall settings or used by another program. Thus to fix the problem, the easiest approach is to change the default port.

Change the default port

For the latest Visual Studio 2019, the integration with Azure Functions with .NET 5 is not great based on my experience and I could not directly change the Application Arguments to make it work.

Thus, I've used command line to run the function locally with port specified via argument --port:

func host start --verbose --port 11000
.net azure-functions visual-studio

Join the Discussion

View or add your thoughts below

Comments