Stop/Kill a running Azure Function
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.
Option #1: Restart Entire Function App (via Azure CLI)
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.
Option #2: Restart IIS Worker Process (via Powershell)
@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.)
This is the order of clicks starting from the portal home page to restart a function app in azure:
-> Function Apps (Found on the very left-hand sidebar, or on dashboard)
-> yourFunction (mine is called 'myFunction')
-> Platform Features (found near the top right of the screen)
-> All Settings (found under the General Settings section)
-> Restart (found near the top of the screen)