I was doing a proof of concept recently and got reminded of something about Azure Functions that really annoys me. It feels like every other time your F5 with Function Apps or Logic Apps Standard you get blocked by Func.exe still running and hanging onto some file lock or other.
It would be really cool if, out of the box a function project just handled this but until then I have a task in my tasks.json which just kills func.exe before the compile. Im sure there is probably a better way to do this but until then this works and stops me turning green. Hope it helps someone else.
- Go to .vscode folder
- Go to tasks.json
- Add a task to the tasks array with the below code
{
"label": "kill func processes",
"type": "shell",
"command": "powershell",
"args": [
"-Command",
"Get-Process -Name 'func' -ErrorAction SilentlyContinue | Stop-Process -Force; Write-Host 'func.exe processes stopped if any were running'"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "silent",
"focus": false,
"panel": "shared"
},
"problemMatcher": []
}
