Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Functions notification on failure

I have timer-triggered Azure functions running in production, but now I want to be notified if the function fails.

In my case, access to various connected services can cause crashes, and there are many to troubleshoot. The crash is the type of error I need notification for.

When the function does fail, the log entry indicates failure, so I wonder if there is a hook in the system that would allow me to cause the system to generate a notification.

I know that blob and queue bindings, for instance, support the creation of poison queue entries, but timer trigger binding doesn't say anything about any trigger outputs of that nature.

I see that functions can pass their $return status as input to other functions, but that operation is not explained in depth in the docs. Also, in that case, I need to write another function to process the error status, and I was looking for something built-in.

I Have inquired with @AzureSupport on this, but their answer had nothing to do with Azure Functions, instead referring me to DLL notification hooks, then recommending I file on uservoice.

I'm sure there must be people here who have implemented some sort of error status notification. I prefer a solution that doesn't require code.

like image 358
Leigh007 Avatar asked May 05 '17 14:05

Leigh007


People also ask

Can Azure Monitor send alerts?

Alerts help you detect and address issues before users notice them by proactively notifying you when Azure Monitor data indicates that there may be a problem with your infrastructure or application. You can alert on any metric or log data source in the Azure Monitor data platform.


1 Answers

The recommended way to monitor and alert on failures is to use AppInsights which integrates fully with Azure Functions now

https://blogs.msdn.microsoft.com/appserviceteam/2017/04/06/azure-functions-application-insights/

Since all the logs are available in AppInsights it's easy to monitor for failures and setup alerts based on your own criteria.

However, if you only care about alerting and not things like monitoring etc, you could use Azure Monitor instead: https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-get-started

like image 78
Chris Avatar answered Oct 28 '22 09:10

Chris