Azurearch Tech

ADF data load on Sql table from blob

This blog help to load data into sql table then process AAS cube using power shell .

{
    "name": "PL_INCR_Master_Full_Load",
    "properties": {
        "activities": [
            {
                "name": "PL_CCB_INCR_Extraction",
                "type": "ExecutePipeline",
                "dependsOn": [
                    {
                        "activity": "SP_InsertUpdateCDCTimestamp",
                        "dependencyConditions": [
                            "Succeeded"
                        ]
                    }
                ],
                "userProperties": [],
                "typeProperties": {
                    "pipeline": {
                        "referenceName": "PL_CCB_Incr_Extraction_Generic",
                        "type": "PipelineReference"
                    },
                    "waitOnCompletion": true,
                    "parameters": {
                        "iscdc": 1
                    }
                }
            },
            {
                "name": "SP_InsertUpdateCDCTimestamp",
                "type": "SqlServerStoredProcedure",
                "dependsOn": [
                    {
                        "activity": "Wait1",
                        "dependencyConditions": [
                            "Succeeded"
                        ]
                    }
                ],
                "policy": {
                    "timeout": "7.00:00:00",
                    "retry": 0,
                    "retryIntervalInSeconds": 30,
                    "secureOutput": false,
                    "secureInput": false
                },
                "userProperties": [],
                "typeProperties": {
                    "storedProcedureName": "[STAGING].[usp_InsertUpdateCDCTimestamp]"
                },
                "linkedServiceName": {
                    "referenceName": "Connection_SQLDB_AzureIR",
                    "type": "LinkedServiceReference"
                }
            },
            {
                "name": "GetMetadataCCBProdFile",
                "type": "GetMetadata",
                "dependsOn": [
                    {
                        "activity": "PL_CCB_INCR_Extraction",
                        "dependencyConditions": [
                            "Succeeded"
                        ]
                    }
                ],
                "policy": {
                    "timeout": "7.00:00:00",
                    "retry": 0,
                    "retryIntervalInSeconds": 30,
                    "secureOutput": false,
                    "secureInput": false
                },
                "userProperties": [],
                "typeProperties": {
                    "dataset": {
                        "referenceName": "DS_ADLS_CCB_PROD_Extract_File",
                        "type": "DatasetReference",
                        "parameters": {
                            "folder_name": "ccbprod",
                            "file_name": "ccb_prod_extraction_completion.txt"
                        }
                    },
                    "fieldList": [
                        "exists",
                        "lastModified",
                        "itemName"
                    ],
                    "storeSettings": {
                        "type": "AzureBlobFSReadSettings",
                        "recursive": true,
                        "enablePartitionDiscovery": false
                    },
                    "formatSettings": {
                        "type": "DelimitedTextReadSettings"
                    }
                }
            },
            {
                "name": "IfFileExistsDelete",
                "type": "IfCondition",
                "dependsOn": [
                    {
                        "activity": "GetMetadataCCBProdFile",
                        "dependencyConditions": [
                            "Succeeded"
                        ]
                    }
                ],
                "userProperties": [],
                "typeProperties": {
                    "expression": {
                        "value": "@activity('GetMetadataCCBProdFile').output.exists",
                        "type": "Expression"
                    },
                    "ifFalseActivities": [
                        {
                            "name": "PL_CCB_Prod_Extraction_InComplete",
                            "type": "ExecutePipeline",
                            "dependsOn": [],
                            "userProperties": [],
                            "typeProperties": {
                                "pipeline": {
                                    "referenceName": "PL_CCB_Prod_Extraction_InComplete",
                                    "type": "PipelineReference"
                                },
                                "waitOnCompletion": true
                            }
                        }
                    ],
                    "ifTrueActivities": [
                        {
                            "name": "PL_INCR_Master_ETL_Load",
                            "type": "ExecutePipeline",
                            "dependsOn": [],
                            "userProperties": [],
                            "typeProperties": {
                                "pipeline": {
                                    "referenceName": "PL_INCR_Master_ETL_Load",
                                    "type": "PipelineReference"
                                },
                                "waitOnCompletion": true
                            }
                        },
                        {
                            "name": "RestartADFMachine",
                            "type": "WebHook",
                            "dependsOn": [
                                {
                                    "activity": "PL_INCR_Master_ETL_Load",
                                    "dependencyConditions": [
                                        "Succeeded"
                                    ]
                                }
                            ],
                            "userProperties": [],
                            "typeProperties": {
                                "url": {
                                    "value": "@pipeline().globalParameters.ADFRestart",
                                    "type": "Expression"
                                },
                                "method": "POST",
                                "body": {
                                    "VMAction": "Stop"
                                },
                                "timeout": "01:10:00"
                            }
                        }
                    ]
                }
            },
            {
                "name": "DeleteCCBProdExtractFileCreated",
                "type": "Delete",
                "dependsOn": [
                    {
                        "activity": "IfFileExistsDelete",
                        "dependencyConditions": [
                            "Completed"
                        ]
                    }
                ],
                "policy": {
                    "timeout": "7.00:00:00",
                    "retry": 0,
                    "retryIntervalInSeconds": 30,
                    "secureOutput": false,
                    "secureInput": false
                },
                "userProperties": [],
                "typeProperties": {
                    "dataset": {
                        "referenceName": "DS_ADLS_CCB_PROD_Extract_File",
                        "type": "DatasetReference",
                        "parameters": {
                            "folder_name": "ccbprod",
                            "file_name": "ccb_prod_extraction_completion.txt"
                        }
                    },
                    "enableLogging": false,
                    "storeSettings": {
                        "type": "AzureBlobFSReadSettings",
                        "recursive": true,
                        "enablePartitionDiscovery": false
                    }
                }
            },
            {
                "name": "AAS Cube Backup",
                "type": "ExecutePipeline",
                "dependsOn": [
                    {
                        "activity": "DeleteCCBProdExtractFileCreated",
                        "dependencyConditions": [
                            "Succeeded"
                        ]
                    }
                ],
                "userProperties": [],
                "typeProperties": {
                    "pipeline": {
                        "referenceName": "PL_AS_AAS_CUBE_BACKUP",
                        "type": "PipelineReference"
                    },
                    "waitOnCompletion": true
                }
            },
            {
                "name": "Wait1",
                "type": "Wait",
                "dependsOn": [],
                "userProperties": [],
                "typeProperties": {
                    "waitTimeInSeconds": 10000
                }
            }
        ],
        "concurrency": 1,
        "annotations": [],
        "lastPublishTime": "2023-03-28T07:58:29Z"
    },
    "type": "Microsoft.DataFactory/factories/pipelines"
}

Later we have execute the sub pipeline below :-

{
    "name": "PL_INCR_Master_ETL_Load",
    "properties": {
        "activities": [
            {
                "name": "PL_INCR_Master_Batch1_Dimensions_Full_Load",
                "type": "ExecutePipeline",
                "dependsOn": [],
                "userProperties": [],
                "typeProperties": {
                    "pipeline": {
                        "referenceName": "PL_INCR_Master_Dimensions_Load",
                        "type": "PipelineReference"
                    },
                    "waitOnCompletion": true
                }
            },
            {
                "name": "PL_INCR_Master_Facts_Full_Load",
                "type": "ExecutePipeline",
                "dependsOn": [
                    {
                        "activity": "PL_INCR_Master_Batch2_Dimensions_Full_Load",
                        "dependencyConditions": [
                            "Succeeded"
                        ]
                    }
                ],
                "userProperties": [],
                "typeProperties": {
                    "pipeline": {
                        "referenceName": "PL_INCR_Master_Facts_Full_Load",
                        "type": "PipelineReference"
                    },
                    "waitOnCompletion": true
                }
            },
            {
                "name": "PL_INCR_Master_Batch2_Dimensions_Full_Load",
                "type": "ExecutePipeline",
                "dependsOn": [
                    {
                        "activity": "PL_INCR_Master_Batch1_Dimensions_Full_Load",
                        "dependencyConditions": [
                            "Succeeded"
                        ]
                    }
                ],
                "userProperties": [],
                "typeProperties": {
                    "pipeline": {
                        "referenceName": "PL_INCR_Master_Batch2_Dimensions_Full_Load",
                        "type": "PipelineReference"
                    },
                    "waitOnCompletion": true
                }
            }
        ],
        "concurrency": 1,
        "annotations": [],
        "lastPublishTime": "2023-01-30T18:28:09Z"
    },
    "type": "Microsoft.DataFactory/factories/pipelines"
}
Exit mobile version