diff --git a/.vscode/settings.json b/.vscode/settings.json index e2ef157..6e8b917 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,5 +5,6 @@ "azureFunctions.projectRuntime": "~4", "debug.internalConsoleOptions": "neverOpen", "azureFunctions.projectLanguageModel": 2, - "azureFunctions.pythonVenv": ".venv" + "azureFunctions.pythonVenv": ".venv", + "python.defaultInterpreterPath": "${workspaceFolder}/src/.venv" } \ No newline at end of file diff --git a/README.md b/README.md index 738be73..b559560 100644 --- a/README.md +++ b/README.md @@ -108,8 +108,16 @@ The `TIMER_SCHEDULE` setting defines when your timer function runs using NCRONTA ## Run your app using Visual Studio Code -1. Open the `src` app folder in a new terminal. +1. Open the repository root, not the `src` app folder, in a new terminal. 2. Run the `code .` command to open the project in Visual Studio Code. + The repository-root `.vscode` configuration runs the Functions host and + dependency tasks from `src` and deploys that folder. Before debugging, create + the environment from the repository root using `python -m venv src/.venv` + (or `py -m venv src\.venv` on Windows), using a Python version from the + prerequisites. + If an interpreter was previously selected, run **Python: Select Interpreter** + and select the environment in `src/.venv`. The default interpreter setting is + only used when the Python extension first loads a workspace. 3. In the command palette (F1), type `Azurite: Start`, which enables debugging without warnings. 4. Press **Run/Debug (F5)** to run in the debugger. Select **Debug anyway** if prompted about local emulator not running. 5. Wait for the timer schedule to trigger your timer function. diff --git a/src/.vscode/extensions.json b/src/.vscode/extensions.json deleted file mode 100644 index 3f63eb9..0000000 --- a/src/.vscode/extensions.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "recommendations": [ - "ms-azuretools.vscode-azurefunctions", - "ms-python.python" - ] -} \ No newline at end of file diff --git a/src/.vscode/launch.json b/src/.vscode/launch.json deleted file mode 100644 index 9a24428..0000000 --- a/src/.vscode/launch.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Attach to Python Functions", - "type": "debugpy", - "request": "attach", - "connect": { - "host": "localhost", - "port": 9091 - }, - "preLaunchTask": "func: host start" - } - ] -} \ No newline at end of file diff --git a/src/.vscode/settings.json b/src/.vscode/settings.json deleted file mode 100644 index c4068dc..0000000 --- a/src/.vscode/settings.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "files.exclude": { - "obj": true, - "bin": true - }, - "azureFunctions.deploySubpath": "src", - "azureFunctions.scmDoBuildDuringDeployment": true, - "azureFunctions.projectLanguage": "Python", - "azureFunctions.projectRuntime": "~4", - "debug.internalConsoleOptions": "neverOpen", - "azureFunctions.projectLanguageModel": 2 -} \ No newline at end of file diff --git a/src/.vscode/tasks.json b/src/.vscode/tasks.json deleted file mode 100644 index 59a8074..0000000 --- a/src/.vscode/tasks.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "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}" - } - }, - { - "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}" - } - } - ] -} \ No newline at end of file