0

I am trying to locally debug a Azure Function App (Python) using VS Code in WSL, Ubuntu 22.04. Unfortunately though, debugging doesn't seem to work.

I have installed and following pre-requisites -

  • Azure extension (and logged in)
  • Azure Functions extension (and created a Function App project using Ctl, Shift + p -> Azure Functions: Create New Project...)
  • Installed azurite (and started using Ctl, Shift + p -> Azurite: Start)
  • Ensure local.settings.json is configured with "AzureWebJobsStorage": "UseDevelopmentStorage=true"

But when I try to debug using the launch configuration Attach to Python Functions from .vscode/launch.json (added when I created a Function App project), an error message is displayed.

Cound not find the task 'func: host start'. enter image description here

Using Ctl, Shift + p and searching for 'func' does support that the task is missing.

However, on the CLI I can confirm that Azure Function App Tools is installed.

user@computer:~$ func --version
4.0.5198

I don't have the Python extension installed for two reasons -

  • It's already installed at the version I require through WSL.
  • Installing it makes the debugger not work - it just freezes and 'Python extension loading...' is displayed in the tool bar forever. Nothing is displayed in the 'Python' output. I have attempted the fix as described in this question, but it does not work.

How can I get a Function App to reliably debug using VS Code?

3
  • had the same problem which disappeared after a few updates of all and everything. For the debugging part I don't like VSCode at all so did that with spyder for code parts. I know it doesn't help. Just a hint it may be related to the installation Commented Jul 26, 2023 at 14:04
  • Does this answer your question? How to solve the problem"Python extension loading..." in visual studio code? Commented Jul 26, 2023 at 14:17
  • @KiranShahi, you mean the accepted solution that I had already referenced in my answer below? Yep! Thanks anyway. Commented Jul 27, 2023 at 8:50

1 Answer 1

0

The issue was entirely because the Python extension was not installed.

As described in the question, I was unable to use the Python extension because it would not start, and the solutions I had tried failed to fix the extension.

Happily I have now found the answer in another Stack Overflow question. Simply disabling telemetry worked in user settings has worked.

"telemetry.telemetryLevel": "all|error|crash|off"
Sign up to request clarification or add additional context in comments.

1 Comment

I should add, after further investigation it seems that the telemetry was failing when being sent over my organisations corporate VPN.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.