Search code examples
azureazure-web-app-serviceazure-functionsazure-functions-runtimeazure-functions-core-tools

Debugging two Azure Functions projects locally


I have two Azure Functions projects.

I have one project, A, running on localhost:7071/api/....

console output of project A, showing port 7071

I have changed the other project, B, to run on localhost:8888/api/...

console output of project B, showing port 8888

I am calling a function which is running on project A from a function in Project B! How can I debug two Azure Functions projects locally? I cannot find any docs to help me.


Solution

  • To fix the issue add the command line switch --nodeDebugPort 5859 to your launching of func host to set the port for one of the sessions.

    If you are launching from within Visual Studio you need to go 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 (again, for one project).

    See this issue and this video.