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

Agarwal, Roshni 6 Reputation points
2021-10-15T16:15:46.127+00:00

Hi,

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 127.0.0.1:9091" error.
Can someone please help?

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

Task.json
{
"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": []
}
]
}

Launch.json:
{
"version": "0.2.0",
"configurations": [

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

}

settings.json
{
"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
}

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,300 questions
{count} vote