Hey,
There are 2 ways which I can think of:
- Ideally a bad design but would guarantee no failed activities and successful pipeline status :
have the logics outside the IF activity within another pipeline and within the true condition of If activity call the pipeline via Execute pipeline activity. In case if file is not present it would go to false part and since there are no activities outside IF activity, the pipeline is completed.
2) Based on some additional activities, it would ensure your pipeline status is success
For understanding the logic, refer this blog last section :
https://datasharkx.wordpress.com/2021/08/19/error-logging-and-the-art-of-avoiding-redundant-activities-in-azure-data-factory/
code:
{
"name": "pipeline1",
"properties": {
"activities": [
{
"name": "If Condition1",
"type": "IfCondition",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"expression": {
"value": "@equals(pipeline().parameters.Test,'1')",
"type": "Expression"
},
"ifFalseActivities": [
{
"name": "Fail2",
"type": "Fail",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"message": "No file",
"errorCode": "2"
}
}
],
"ifTrueActivities": [
{
"name": "Wait3",
"type": "Wait",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"waitTimeInSeconds": 1
}
}
]
}
},
{
"name": "Wait1",
"type": "Wait",
"dependsOn": [
{
"activity": "Wait2",
"dependencyConditions": [
"Skipped"
]
}
],
"userProperties": [],
"typeProperties": {
"waitTimeInSeconds": 1
}
},
{
"name": "Wait2",
"type": "Wait",
"dependsOn": [
{
"activity": "If Condition1",
"dependencyConditions": [
"Failed"
]
}
],
"userProperties": [],
"typeProperties": {
"waitTimeInSeconds": 1
}
}
],
"parameters": {
"Test": {
"type": "string",
"defaultValue": "1"
}
},
"annotations": [],
"lastPublishTime": "2021-12-23T04:20:07Z"
},
"type": "Microsoft.DataFactory/factories/pipelines"
}