Home > Mobile >  I want to send out a mail when an activity is retrying after an initial failure
I want to send out a mail when an activity is retrying after an initial failure

Time:05-18

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.

CodePudding user response:

You can create an Alert in Azure Data Factory (ADF) Monitor section under Alerts and Metrics option.

  1. Go to Monitor section on ADF Studio and click on Alerts and Metrics then New alert rule as shown below.

enter image description here

  1. 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 criteria for this alert.

enter image description here

  1. From the given list, choose the Failed activity runs metrics criteria and click on Continue. This will create a criteria for the failed activity based on your Configuration alert logic in next step. Under configuration you can mention the count for how each time the activity fails you will get the alert.

enter image description here

  1. Now click on Configure Notification option in step 2 image.

  2. Give an action name. Under Select which notification you'd like to receive check mark Email and give the email address on which you want to give alert. Click on Add notification.

Now you will get notification every time the activity fail.

enter image description here

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.

  • Related