I'm using version 2.0.1-beta.22, and debugging locally has mysterious stopped working for me. I updated visual studio to 15.5.6 and rebooted a couple of times and still have this problem.
I tried updating my local.settings.json file to have a host section like this:
"Host": {
"LocalHttpPort": 7072,
"CORS": "*"
},
... but it still tries to start on port 7071, so it appears to be ignoring this file. I double-checked to make sure the file was copied into the same folder as the host.json file.
I was able to run this successfully with my azure functions project only a few weeks ago. Any ideas?
I'd expect the cli to quickly display an error if the port was already taken. Are there any other logs printed to the console?
regarding the cli not respecting the port in local.settings.json, the problem is that VS launches the it with this command
"C:\Program Files\dotnet\dotnet.exe" C:\Users\<usr>\AppData\Local\Azure.Functions.V2.Cli\2.0.1-beta.22\Azure.Functions.Cli.dll host start --port 7071 --pause-on-error
which makes the port there take precedence over the setting in local.settings.json I will sync up with VS to launch without specifying a port so that you can easily override it in the file.
Try Right click on project -> Properties -> Debug, then update it to look like this (of course replacing

Sorry for the delay...
No other logs are printed to the console. The output looks like this:
Listening on http://localhost:7071/
Hit CTRL-C to exit...
The host is taking longer than expected to start.
The host is taking longer than expected to start.
The host is taking longer than expected to start.
...
As for the debug settings suggestion, There is no "Azure.Functions.V2.Cli" directory on my computer, but there is this:
C:\Users\ericj\AppData\Roaming\npm\node_modules\azure-functions-coretools\bin\Azure.Functions.Cli.dll
So it looks like I have [email protected] installed. I've searched around and it's not clear how I install azure functions cli 2.0. I tried that dll anyway and it gives an "invalid argument" error.
If I remove the dll argument and just put "host start --pause-on-error" then I get this output
Listening on http://localhost:7072/
Hit CTRL-C to exit...
The host is taking longer than expected to start.
...
So, that is at least picking a different port, but I'm still getting the "taking longer than expected" warning. I have no idea what to try next.
Edit: I saw a recommendation to run netsh http show urlacl http://+:7071 in another post. I tried that for both 7071 and 7072 and there are no entries listed.
Found the problem. For some reason, I had put in dummy values in the local settings:
"Values": {
"AzureWebJobsStorage": "foo",
"AzureWebJobsDashboard": "bar"
When I changed these to blank values, everything works as before.
Most helpful comment
Found the problem. For some reason, I had put in dummy values in the local settings:
When I changed these to blank values, everything works as before.