'Port Error - Visual Studio 2022: Azure Function - Port 7071 is unavailable

I am getting below error while debugging two Azure function locally in visual studio 2022

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


Solution 1:[1]

For Visual Studio 2022, the fix is slightly different.

Open project properties and then go to Debug -> Open debug launch profiles UI.

Input the following line with the port you want to use:

host start --port 11000

enter image description here

The above fix works for .NET 6 Azure functions that runs as Project instead of isolated process

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rakesh Kumar