I built out a pipeline in Azure DataFactory to run a Databricks process. Depending on many variables, the databricks process can take 10 hours to run or 18 hours to run. I have an email notification set up through logic apps/Web activity in Data Factory to send me an email when the process is completely finished. However, I can not figure out how I pull in the "duration" of the trigger run into that success email.
This snippet is included in the "Body" section of the Web activity in Data Factory:
{"message":"@{activity('NAME OF ACTIVITY').output.dataWritten}","dataFactoryName":"@{pipeline().DataFactory}","pipelineName":"@{pipeline().Pipeline}","receiver":"@pipeline().parameters.receiver"}
This is the HTTP Request I have in Logic APP:
{
"properties": {
"DataFactoryName": {
"type": "string"
},
"EmailTo": {
"type": "string"
},
"ErrorMessage": {
"type": "string"
},
"PipelineName": {
"type": "string"
},
"Subject": {
"type": "string"
}
},
"type": "object"
}
I expect a success email sent to my email with Your pipeline took xx hrs and xx minutes to run on mm/dd/yyyy