I noticed I have multiple functions running but never ending because they never get to the context.done()
call. (This is a NodeJS function).
How can I stop these running functions without having to delete the entire function?
The recommended way to disable a function is with an app setting in the format AzureWebJobs. <FUNCTION_NAME>. Disabled set to true . You can create and modify this application setting in a number of ways, including by using the Azure CLI and from your function's Overview tab in the Azure portal.
Use command line to kill the process. Right click on project> Show in Local Terminal> Terminal, input TASKKILL /IM func.exe /T /F to kill func.exe . Run function in terminal hence we can terminate it.
Durable Functions is an extension of Azure Functions that lets you write stateful functions in a serverless compute environment. The extension lets you define stateful workflows by writing orchestrator functions and stateful entities by writing entity functions using the Azure Functions programming model.
Trigger based executions Azure Functions get executed based on the configured triggers. It supports various triggers like HTTP Triggers, Queue Trigger, Event Hub Trigger and more. Being as a trigger-based service, it run on demand.
You have the ability to simply restart the Function App site, which will kill any functions (Function App Settings > Go To App Service Settings > Restart).
If you are running on a dynamic plan, please make sure you have upgraded to the latest version of the runtime, as a timeout feature is now in effect and will prevent functions from executing indefinitely.
For automation purposes, you can use the Azure CLI 2.0 (local azure shell) which makes this so much easier than clicking around in the portal blades.
This also works in the portal cloud shell if so desired.
az functionapp restart --name <functionappName> --resource-group <resourceGroup>
You can also restart the function app by killing the running w3wp.exe
process - there is a watchdog that will automatically restart it.
@powershell kill -name w3wp
Kudu will allow you to do this manually via Debug Console and entering the command above or clicking thru Process Explorer->Properties->Kill.
Note: Killing the IIS worker process is all that is required as any spawned child processes will also be terminated (dotnet.exe, node, etc.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With