AgarwalRoshni-2770 avatar image
0 Votes"
AgarwalRoshni-2770 asked PramodValavala-MSFT commented

Unable to attach debugger to function app running locally : connect ECONNREFUSED


I am trying to run function app on my local mac using VS code. But I am not able to attach the debugger. I throws "connect ECONNREFUSED" error.
Can someone please help?

OS: MacOS Big Sur (ver: 11.6)
Core tool version : 3
node version:12.22.6

"version": "2.0.0",
"tasks": [
"type": "func",
"command": "host start",
"problemMatcher": "$func-python-watch",
"isBackground": true,
"dependsOn": "func: extensions install"
"type": "func",
"command": "extensions install",
"dependsOn": "pipInstall",
"problemMatcher": []
"label": "pipInstall",
"type": "shell",
"osx": {
"command": "${config:azureFunctions.pythonVenv}/bin/python -m pip install -r requirements.txt"
"windows": {
"command": "${config:azureFunctions.pythonVenv}\\Scripts\\python -m pip install -r requirements.txt"
"linux": {
"command": "${config:azureFunctions.pythonVenv}/bin/activate && func extensions install && pip install -r requirements.txt && func host start"
"problemMatcher": []

"version": "0.2.0",
"configurations": [

         "name": "Attach to Python Functions",
         "type": "python",
         "request": "attach",
         "port": 9091,
         "preLaunchTask": "func: host start"


"azureFunctions.deploySubpath": ".",
"azureFunctions.pythonVenv": ".venv",
"azureFunctions.projectLanguage": "Python",
"azureFunctions.projectRuntime": "~3",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.preDeployTask": "pipInstall",
"python.linting.pylintEnabled": true,
"python.linting.pycodestyleEnabled": false,
"python.linting.enabled": true,
"python.terminal.activateEnvInCurrentTerminal": true,
"files.exclude": {
"obj": true,
"bin": true
"azureFunctions.scmDoBuildDuringDeployment": true

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AgarwalRoshni-2770 This is likely due to the python worker not starting up or doing so on a different port. Could you share logs?

0 Votes 0 ·

0 Answers