Open
Description
openedon Dec 14, 2022
Hi there,
It seems like by default, the azure functions extension completely ignores the selected python path, and instead just uses python in the default path. I troubleshot this issue for days and learned way more about debugging than I ever wanted to to get it working.
Basically, the workaround is as follows:
My tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "func: host start",
"command": "conda activate AzureFunctions ; func host start --language-worker -- '-m ptvsd --host 127.0.0.1 --port 9091'",
"problemMatcher": "$func-python-watch",
"isBackground": true
}
]
}
I understand that you may not want to support conda out of the box, but it would be nice if it would respect the Selected Interpreter when testing.
After finding a solution I looked for similar issues and this issue and solution have been closed multiple times:
#2750
#3263
#3332 - Sort of?
Repro Steps
- Install Anaconda
- Create virtual environment using the following command in an anaconda prompt: conda create -n AzureFunctions python=3.9.7
- Activate Environment: conda activate AzureFunctions
- Install debugger: conda install ptsvd
- Install Azure-functions: pip install azure-functions
- Navigate to ~/Anaconda3/envs
- Set python.pythonPath=%userprofile%\Anaconda3\envs\AzureFunctions
- Create function project.
- Hit F5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels