azure-data-factory

Azure Data Factory (ADF) create an alert to notify me when a pipeline is triggered


Is it possible to create an alert that it will notify me when an adf pipeline is triggered?

I know what metric to pick for success or failure but now sure what to use for triggering a pipeline:

enter image description here

My pipeline is triggered by an adf trigger when a .csv file arrives in datalake container

When I try to create an AirflowIntegrationRuntimeTriggersSucceeded metric alert I get the below error message:

The metric AirflowIntegrationRuntimeTriggersSucceeded
specifies a dimension Name which was not found.
The metric AirflowIntegrationRuntimeTriggersSucceeded
specifies a dimension FailureType which was not found.
Activity ID: xxx-xxxx-xxx-xxxx-xxx.

Solution

  • Currently, an alert when the pipeline triggered might not be supported in ADF alerts. You can try the below approach as a workaround if you have access to update the pipeline.

    Go to the pipeline and add a Set variable activity before all of your activities. Give any value to the variable. Set a unique activity name to it like below.

    enter image description here

    Publish the changes of the pipeline and now go to the alerts. In the alerts, use the option Succeeded activity runs metrics as Target criteria and give your activity details like below.

    enter image description here

    So, whenever a pipeline starts by the trigger, the first activity (The above set variable activity) will be executed, and it will be succeeded, and the pipeline run will proceed with next activities. Now, the alert mail will be trigged upon the success of this activity.

    enter image description here

    (OR) You can use logic apps for the alert mail. Before all the activities use a web activity to call the logic app and send the mail using logic app action. In this method you can also send any values if required like pipeline run id as parameters.

    enter image description here

    You can go through this documentation to know how to use logic app to send mail from ADF pipeline web activity.