{ "name": "looping", "properties": { "activities": [ { "name": "Set StartDate", "type": "SetVariable", "dependsOn": [], "userProperties": [], "typeProperties": { "variableName": "Startdate", "value": { "value": "@formatDateTime(AddToTime(utcnow(), -1, 'Month'), 'yyyy-MM-dd')", "type": "Expression" } } }, { "name": "Set Enddate", "type": "SetVariable", "dependsOn": [], "userProperties": [], "typeProperties": { "variableName": "Enddate", "value": { "value": "@formatDateTime(utcnow(), 'yyyy-MM-dd')", "type": "Expression" } } }, { "name": "Until1", "type": "Until", "dependsOn": [ { "activity": "Set Enddate", "dependencyConditions": [ "Succeeded" ] }, { "activity": "Set StartDate", "dependencyConditions": [ "Succeeded" ] }, { "activity": "Set Date", "dependencyConditions": [ "Succeeded" ] } ], "userProperties": [], "typeProperties": { "expression": { "value": "@equals(variables('date'),replace(variables('Enddate'),'-',''))", "type": "Expression" }, "activities": [ { "name": "Set date variable", "type": "SetVariable", "dependsOn": [], "userProperties": [], "typeProperties": { "variableName": "date", "value": { "value": "@replace(formatDateTime(addDays(variables('Startdate'),int(variables('counter'))),'yyyy-MM-dd'),'-','')", "type": "Expression" } } }, { "name": "Set Indexvalue", "type": "SetVariable", "dependsOn": [ { "activity": "Set date variable", "dependencyConditions": [ "Succeeded" ] } ], "userProperties": [], "typeProperties": { "variableName": "indexvalue", "value": { "value": "@string(add(int(variables('counter')),1))", "type": "Expression" } } }, { "name": "Set Counter", "type": "SetVariable", "dependsOn": [ { "activity": "Set Indexvalue", "dependencyConditions": [ "Succeeded" ] } ], "userProperties": [], "typeProperties": { "variableName": "counter", "value": { "value": "@variables('indexvalue')", "type": "Expression" } } }, { "name": "Get Metadata1", "type": "GetMetadata", "dependsOn": [ { "activity": "Set Counter", "dependencyConditions": [ "Succeeded" ] } ], "policy": { "timeout": "7.00:00:00", "retry": 0, "retryIntervalInSeconds": 30, "secureOutput": false, "secureInput": false }, "userProperties": [], "typeProperties": { "dataset": { "referenceName": "Binary1", "type": "DatasetReference", "parameters": { "foldername": { "value": "@variables('date')", "type": "Expression" } } }, "fieldList": [ "exists" ], "storeSettings": { "type": "AzureBlobFSReadSettings" }, "formatSettings": { "type": "BinaryReadSettings" } } }, { "name": "If Condition1", "type": "IfCondition", "dependsOn": [ { "activity": "Get Metadata1", "dependencyConditions": [ "Succeeded" ] } ], "userProperties": [], "typeProperties": { "expression": { "value": "@activity('Get Metadata1').output.exists", "type": "Expression" }, "ifTrueActivities": [ { "name": "Copy data1", "type": "Copy", "dependsOn": [], "policy": { "timeout": "7.00:00:00", "retry": 0, "retryIntervalInSeconds": 30, "secureOutput": false, "secureInput": false }, "userProperties": [], "typeProperties": { "source": { "type": "BinarySource", "storeSettings": { "type": "AzureBlobFSReadSettings", "recursive": true, "wildcardFileName": "*.*", "deleteFilesAfterCompletion": false }, "formatSettings": { "type": "BinaryReadSettings" } }, "sink": { "type": "BinarySink", "storeSettings": { "type": "AzureBlobFSWriteSettings" } }, "enableStaging": false }, "inputs": [ { "referenceName": "Binary1", "type": "DatasetReference", "parameters": { "foldername": { "value": "@variables('date')", "type": "Expression" } } } ], "outputs": [ { "referenceName": "Binary2", "type": "DatasetReference" } ] } ] } } ], "timeout": "7.00:00:00" } }, { "name": "Set Date", "type": "SetVariable", "dependsOn": [], "userProperties": [], "typeProperties": { "variableName": "date", "value": { "value": "@formatDateTime(AddToTime(utcnow(), -1, 'Month'), 'yyyy-MM-dd')", "type": "Expression" } } } ], "variables": { "Startdate": { "type": "String" }, "Enddate": { "type": "String" }, "date": { "type": "String" }, "counter": { "type": "String", "defaultValue": "1" }, "indexvalue": { "type": "String" } }, "annotations": [], "lastPublishTime": "2020-11-16T08:30:58Z" }, "type": "Microsoft.DataFactory/factories/pipelines" }