0

I created some http functions using java and deployed to. Azure function app but now I need to trigger Email notifications to end users if function fail For this I have created alert rule resource with some condition query & Action group resources for sending emails and sms but, it is delaying sending notifications for 15min So please suggest me how to trigger notifications if my function fails?

Balu
  • 9
  • 5
  • please check my [SO-thread](https://stackoverflow.com/questions/73819153/azure-functions-consumption-timeout-alert/73877412#73877412) answer, is This helpful? – RithwikBojja Oct 06 '22 at 03:09
  • Hi Rithwik sorry for late response & Thanks for answering.... Can you please explain me how your below condition query works? requests | where duration > 1000 – Balu Oct 11 '22 at 04:34

1 Answers1

0

In continuation to comments, please find below answer.

requests  
| where duration > 1000

requests is the table that contains our duration time, source, result of function, etc.

enter image description here

Duration is the time taken to completely run the azure function. If the function takes more than specified minutes, it sends an alert. So, it sends notification in form of alert.

1000 is in milliseconds.(1000 milliseconds)

RithwikBojja
  • 5,069
  • 2
  • 3
  • 7
  • Great!... But my functions are http functions that will copy file from one container to another container so, sometimes my function will run 10sec, 20sec etc., Based on File size to copy so, I think this condition query don't work for me – Balu Oct 11 '22 at 17:15
  • I given. ''' union (requests), (exception) |where success=false |where timestamp> ago(1d). ''' but this condition not triggering email notifications immediately it is sending email after 5-15min, when function failed – Balu Oct 11 '22 at 17:18
  • Also I need to know one thing, is it possible to create new table in Application insight? – Balu Oct 11 '22 at 17:23
  • Yes, you can create a table in [log analytics](https://learn.microsoft.com/en-us/rest/api/loganalytics/tables/create-or-update?tabs=HTTP) – RithwikBojja Oct 12 '22 at 07:33
  • Yaa... I know we can in log analytics resource but, is it possible in application insight resource? – Balu Oct 12 '22 at 09:40
  • AFAIK, we cannot in application insights. – RithwikBojja Oct 12 '22 at 10:04