I am running an HTTP-Triggered Azure Durable Function with a nested orchestrator structure. A single execution of the function can run for multiple hours and make hundreds of database operations.
During development and testing, I am running the function locally in my VS Code [MacOS] in debugging mode. In order to stop the process from running, I simply hit Ctrl + C to kill the process.
The problem: When I restart the debugger, the function continues where it left off and executes extremely long-running processes. I am unable to figure out how to fully stop the previously started processes. I can tell they are running by the logs I see in my terminal.
When starting an HTTP Triggered Function, I get the "statusQueryGetUri"
and "terminatePostUri"
which I would usually use to stop the function, however I have no idea which execution is currently running, and I am not aware of how I could retrieve the ID which would allow me to terminate the run which is still active.
This is what my launch.json file looks like:
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Python Functions",
"type": "python",
"request": "attach",
"port": 9091,
"preLaunchTask": "func: host start"
}
]
}
My function is connected to my dev database and to the dev blob storage.
azure-functions==1.17.0
azure-functions-durable==1.2.6
VS Code: Version: 1.90.2
OS: Darwin arm64 23.3.0
I tried:
- restart my VS Code and my computer.
- searched for any locally stored state but couldn’t find any files.
- tried to kill the process via terminal
ps aux | grep python
thenkill -9 ID
I am expecting:
I am expecting to start my debugger and see my azure function idling until I start the HTTP trigger via postman. Then when I run a function but stop it again by killing the terminal or process, I am expecting it to not continue the next time I start the debugger again.