I'm looking for an elegant way to send an email notification in case a Stream Analytics job detects that a threshold was passed - roughly the same as shown on Channel 9 by Santosh Balasubramanian.
Upon passing the threshold, a record is written to a SQL table. This should trigger an email to be sent.
For a second, I thought I could a Mobile Services 'insert' script defined on that table as explained here, but of course, the Stream Analytics job doesn't pass through the Mobile Services API...
Best option I could think of so far is using a Mobile Services Scheduled Job instead, which would poll the table every 5 minutes or so, and send an email if new records are found.
Is there a better way? Or should I add a feature request for Stream Analytics to enable Mobile Services as output type?
A possible implementation that I have done which emails you in the event of an anomaly detection is the following:
Please refer to this documentation on how to subscribe to an Azure Event Hub. https://azure.microsoft.com/en-us/documentation/articles/service-bus-event-hubs-csharp-ephcs-getstarted/
You will want to send the email in the following section of the documentation mentioned above: