0

I was working in the azure core tools version 2 and recently updated to version 3. Now I am not able to run any functions as it is showing error message "connect Econnrefused 127.0.0.1:9091".

Here is my launch.json

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

I am working on windows machine and using 1.6.1 azure functions versions.

Do I have to change something? I checked and this is common error and reinstalling the extensions should work?I tried all those. Do you think, I am missing anything ?

RRP
  • 25
  • 5

1 Answers1

0

Please check if the below workarounds help to:

Approach 1: Use Integrated terminal in the VS Code and then run the Azure Functions Python:

I will also get this issue most of the time and My working launch.json configuration will be like this:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current file",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        },
        {
            "name": "Azure Functions",
            "type": "python",
            "request": "attach",
            "port": 9091,
            "preLaunchTask": "func: host start"
        }
    ]
}

Approach 2: If the above approach gets the issue still, then try changing the port number and then run the Azure Functions Python.

Approach 3:

Instead of running the Azure Functions Python from the VS Code built-in Run Menu, try with the commands func host start in the integrated terminal like:

enter image description here

If that does not help you, please refer to this workaround given here which solves the specific error of Azure Function Python - Error Connection Refused.