2

I'm trying to debug locally a project that is deployed on Microsoft Azure.

I have a copy of the repository on my PC and setup the launch.json file as:

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


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

This has been working for days, but today is suddenly giving me problems. When in VSCode I click "Start debugging" I can see VSCode opening a new terminal, installing the dependencies specified in the virtual environment and executing func: host start as requested.

However, without a clear reason, today VSCode started showing an error message saying

connect ECONNREFUSED 127.0.0.1:9091

How can I fix this?

PS: I'm not an expert of VSCode, so please let me know if I omitted any useful information and I will add it.

SwethaKandikonda
  • 7,513
  • 2
  • 4
  • 18
Luca
  • 1,610
  • 1
  • 19
  • 30

1 Answers1

0

I have been receiving the same error quite a few times while I'm trying to run the azure function from Run -> Run without Debugging One of the workarounds that worked for me is to use the command func host start from the terminal.

enter image description here

Alternatively, you can update the .vscode/tasks.json file. For more information on this, you can check VSCode is not starting Func Host Start properly

SwethaKandikonda
  • 7,513
  • 2
  • 4
  • 18
  • Once again: Please stop posting comments after answering, asking if you've solved someone's problem. Also: Please be sure to post properly formatted text, not images of text. See [Please do not upload images of code/data/errors when asking a question.](//meta.stackoverflow.com/q/285551) for reasons why this is important. – David Makogon May 20 '22 at 11:08