I have created 2 Python (V2 Programming model) Azure Functions in Vs Code and used a workspace. When I click F5 or start debugging, only the first project session starts debugging, but not the second. When I use func start in terminal for second project, it starts the project but I need to debug rather than just run. Following are my configuration files -
Launch.json
{
"configurations": [
{
"name": "Attach to Preferences",
"type": "python",
"request": "attach",
"port": 9091,
"preLaunchTask": "func: host start",
"project": "${workspaceFolder}/API.Preferences"
},
{
"name": "Attach to Charts",
"type": "python",
"request": "attach",
"port": 7071,
"preLaunchTask": "func: host start",
"project": "${workspaceFolder}/API.Charts"
}
]
}
Settings.json
{
"azureFunctions.deploySubpath": ".",
"azureFunctions.scmDoBuildDuringDeployment": true,
"azureFunctions.pythonVenv": ".venv",
"azureFunctions.projectLanguage": "Python",
"azureFunctions.projectRuntime": "~4",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.projectLanguageModel": 2,
"azureFunctions.projectSubpath": "API.Charts"
}
Tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "func",
"label": "func: host start",
"command": "host start",
"problemMatcher": "$func-python-watch",
"isBackground": true,
"dependsOn": "pip install (functions)",
"options": {
"cwd": "${workspaceFolder}/API.Preferences"
}
},
{
"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": [],
"options": {
"cwd": "${workspaceFolder}/API.Preferences"
}
}
]
}
code.workspace.json file
{
"folders": [
{
"path": ".."
},
{
"path": "../API.Preferences"
},
{
"path": "../API.Charts"
}
],
"settings": {
"debug.internalConsoleOptions": "neverOpen"
},
"launch": {
"configurations": [],
"compounds": [
{
"name": "Attach to both apps",
"configurations": [
"Attach to Preferences",
"Attach to Charts"
]
}
]
}
}
Any help would be greatly appreciated

