Azure / azure-functions-vs-build-sdk

MSBuild task for Azure Functions
MIT License
98 stars 65 forks source link

Question: watchdog for Azure Function - how to do it? #513

Open esmeweaterwax opened 3 years ago

esmeweaterwax commented 3 years ago

From time to time we face an issue that our Azure Function starts to throw 503 response code, freezes and must be restarted manually to get back to normal. We would like to have watchdog mechanism, which will detect that Azure Function throws number of errors from defined range in defined timeframe above defined threshold, then will log an event, send an e-mail alert to given mailing list and restart service. We would like also to configure it and deploy it via ARM templates. I found some info about Azure App Service Auto Healing and custom auto heal rules, but it is possible to define only one custom action at the same time: if we will turn on "recycle process" action, then we cannot enable also "log event" action. I do not see there any "send e-mail" action available too. In one of our projects we use Azure Monitor to send e-mail notifications, but I did not found an info is it possible to restart service from that mechanism? Can you suggest some solution for such usecase?