You would need to do all these steps inside of a logic app, with the steps summarized like this
- Logic App triggered by the alert
- Logic app checks sent emails, filtering for a field that uniquely identifies that alert, such as a formatted subject.
- If the email exists, do nothing
- If the email does not exist, send the email
Alternatively you could:
- Logic App triggered by the alert
- Logic app checks a table in storage account for data relating to sending this email for this alert
- If the data exists, do nothing (or just increment a count field on the table)
- If the data does not exist, send the email
- Add / update the row in the table relating to sending the email
Or you could do something similar if the logic app is logging to Log Analytics, by querying the steps there. Either way you want to trigger the logic app to perform the relevant checks and make the decision on whether the email should be sent or not.
I hope this helps provide you with the information you need. If it does, please make sure to mark the question as answered so it helps other people in future.
Kind regards
Alistair