Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging multiple func projects causes incorrect local.settings.json to be loaded #310

Closed
MattHoneycutt opened this issue Nov 7, 2017 · 4 comments
Assignees

Comments

@MattHoneycutt
Copy link

Is doing debugging multiple Azure Function projects with Visual Studio supported? I've configured 4 separate function projects to start up, and while it usually works now that I've forced each to use a different port, I sometimes see strange behavior, including func.exe seemingly picking up the wrong local.settings.json file.

For example, let's say I have functions A through D, and all four are set as startup projects for debugging in Visual Studio.

Sometimes when I start debugging, function D will seem to have settings from function A, even though it is running the code for function D.

I also occasionally see errors like this:

Error: listen EADDRINUSE :::5858
at Object.exports._errnoException (util.js:1020:11)
at exports._exceptionWithHostPort (util.js:1043:20)
at Agent.Server._listen2 (net.js:1258:14)
at listen (net.js:1294:10)
at net.js:1404:9
at _combinedTickCallback (internal/process/next_tick.js:83:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

And like this:
Error updating ConfigurationManager.AppSettings

And a few other random errors that make me think there's somehow a race condition between the processes.

Please let me know if there are any other details that I can provide.

@leftler
Copy link

leftler commented Nov 10, 2017

I was just provided a workaround for issue on the VS function app tooling repository for a similar issue Azure/Azure-Functions#584

To fix the issue add the command line switch --nodeDebugPort 5859 to your launching of func host to set the port. If you are getting other errors about the port 7071 being in use you need to specify the port for the host in your local.settings.json that should be used instead.

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "",
    "AzureWebJobsDashboard": ""
  },
  "Host": {
    "LocalHttpPort": 7072,
    "CORS": "*"
  }
}

If you are launching from within visual studio you need to project -> properties -> Debug, then under Application arguments you need to pass in a value that looks similar to host start --pause-on-error --nodeDebugPort 5859, Visual Studio does not currently respect the Host.LocalHttpPort setting when starting the debugger unless you use host start --pause-on-error as an argument.

@MattHoneycutt
Copy link
Author

Thanks, I'll give that a shot!

@HowardvanRooijen
Copy link

It would be really nice if --nodeDebugPort setting was added to the "Host" configuration setting, then at least we wouldn't have configuration sprinkled throughout the solution / IDE.

@ahmedelnably
Copy link
Contributor

Closing, please try this in v2 or v3 version of the core tools

@ghost ghost locked as resolved and limited conversation to collaborators Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants