'I want to send out a mail when an activity is retrying after an initial failure
I have a Azure Data factory pipeline in which have a activity that runs a sql script. I have retry setup on Activity for it to run again after its fails on first run. I want to send an email when it fails on its first run and is retrying.
I have tried to set up a failure output from activity to send a mail. But it will retry without sending the mail (through web activity).
I want to send email once it fails in its first run and is retrying on second run.
Solution 1:[1]
You can create an Alert in Azure Data Factory (ADF) Monitor section under Alerts and Metrics option.
- Go to
Monitorsection on ADF Studio and click onAlerts and MetricsthenNew alert ruleas shown below.
- Give a alert rule name to new alert rule. Provide a description about the rule. Give a Severity for this alert and then click on
+ Add criteriafor this alert.
- From the given list, choose the
Failed activity runs metricscriteria and click on Continue. This will create a criteria for the failed activity based on yourConfiguration alert logicin next step. Under configuration you can mention the count for how each time the activity fails you will get the alert.
Now click on
+ Configure Notificationoption in step 2 image.Give an
action name. UnderSelect which notification you'd like to receivecheck mark Email and give the email address on which you want to give alert. Click onAdd notification.
Now you will get notification every time the activity fail.
Note: The retry you should mention in the activity level to run it required number of times after failure. You will get the failure alert for each time the activity re-run and fail.
To know more check official document Data Factory metrics and alerts.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |




