I am trying to debug Azure functions python code using VS code IDE.
Local.settings.json is updated with below config
"AzureWebJobsStorage": "UseDevelopmentStorage=true"
Things I tried so far :-
- I reinstalled VS code,
- Downgraded Azure Function Core Tools from 4.0 to 3.0
- Any pointers to solve this issue will be super helpful.
Below is the error on VS Code IDE when trying to debug Azure function written in Python:
Host.json below
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[2.*, 3.0.0)"
},
"functionTimeout": "20:00:00",
"extensions": {
"durableTask": {
"maxConcurrentActivityFunctions": 1
}
}
}
launch.json below
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Python Functions",
"type": "python",
"request": "attach",
"port": 9091,
"preLaunchTask": "func: host start"
}
]
}
task.json
{
"version": "2.0.0",
"tasks": [
{
"label": "cmd host start",
"type": "shell",
"dependsOn": "pip install (functions)",
"windows": {
"command": ". ${config:azureFunctions.pythonVenv}\\Scripts\\activate && func host start --verbose"
},
"isBackground": true,
"problemMatcher": "$func-python-watch"
},
{
"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/python -m pip install -r requirements.txt"
},
"problemMatcher": []
},
{
"type": "func",
"command": "host start",
"problemMatcher": "$func-python-watch",
"isBackground": true,
"dependsOn": "func: extensions install"
},
{
"type": "func",
"command": "extensions install",
"dependsOn": "pip install (functions)",
"problemMatcher": []
},
{
"label": "pip install (functions)",
"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/python -m pip install -r requirements.txt"
},
"problemMatcher": []
}
]
}