skip to Main Content

I need to send an email whenever my pipeline runs longer then 10mins. For sending mail I am using logic app but how to check if the time exceeds then 10mins? How can we check and do this in the pipeline itself? Can anyone kindly help me on this

2

Answers


  1. To send mail if ADF Pipeline runs more then 10min use Wait activity in parallel of your main pipeline and set the time to wait in seconds for 10 min(600 sec) in wait activity

    enter image description here

    After that with the Rest Api get the status of pipeline through web activity.

    URL: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/pipelineruns/@{pipeline().RunId}?api-version=2018-06-01
    

    enter image description here

    Then in the If activity the status of pipeline run is In Progress with expression @equals(activity('Web1').output.value.status,'In progress') then send the mail using web activity(logic app)

    enter image description here

    refer this SO answer to more unerstanding on rest api with web activity

    Login or Signup to reply.
  2. You can follow the below flow to achieve the ask :

    1. at the end of the normal flow, have a set variable activity to assign a value to a variable w.r.t Pipeline status
    2. In parallel , have an until activity to validate whether the execution time has exceeded the timeout value or the pipeline has completed and accordingly, take the necessary actions.

    below blog explains it in detail :
    https://datasharkx.wordpress.com/2023/09/21/auto-cancel-long-running-pipelines-within-synapse-azure-data-factory/

    Rather than pipeline cancellation, you can use logic app to trigger email

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search