I want to send emails through application insight for certain events like validation failure, mandatory field not present etc.
I know Application insight doesn't have facility to support Email facility directly, but it can send an alert when a metric crosses a threshold.
Alerts can be set on custom metrics, though not custom events. Write some code to increase a metric when the event occurs.
I am referring below link to achieve email sending functionality.
But I am facing one problem. Alarm option is not in metric. Please see below images.
You can create an automated flow to query your events and send you an email whenever the query result passes some threshold.
The Application Insights Connector which works both for Flow and Microsoft Logic Apps was created just for that, and can be defined on any query result from any document type (event, metric or even traces).
Step-by-step documentation on how to create your own flow are here
来源:https://stackoverflow.com/questions/44795804/want-to-send-email-on-an-events-in-my-app