It’s still in the works, but the Azure Functions team released a preview version of the “Visual Studio Tools for Azure Functions”. At this time, you’ll need VS2015 Update 3 installed to get this to work, check out https://blogs.msdn.microsoft.com/webdev/2016/12/01/visual-studio-tools-for-azure-functions/ for further instructions.
So all excited I downloaded the tools, installed them and created my first local Function to debug from Studio. Unfortunately, it didn’t work. I got two command prompt windows which disappeared after a short while. No error, no debug, nothing. Hmmm….
A good next step is to run the functions CLI locally. You’ll need to have the CLI installed for this. Simply head over to the folder where you’ve just created your project and run “func host start”. In my case, this resulted in the following error:
“HTTP could not register URL http://+:7071/. Your process does not have access rights to this namespace”
You can assume that Visual Studio is facing the same issue, as it is also using the CLI underwater to host the functions. So what now? I found that the following command will list all of the registered http services:
netsh http show urlacl > c:\http.txt
Check that http.txt file and you’ll see there probably is an entry for http://+:7071/ in there. I had nothing running on that port as far as I was aware so I decided to simply delete the reservation:
netsh http delete urlacl https://+:7071/
And there you go, the port is now freed up and both the CLI as well as debugging from Visual Studio (not at the same time, obviously) started working! 🙂