Loading Files to Azure

Shailaja Reddy Mudugulla 26 Reputation points
2022-12-21T09:44:33+00:00

Hello,

Im loading files from SD card to Azure. Here we are manually triggering the pipeline because each file is taking certain time to load. For eg., one file might take less than 5 minutes and the other might take more than an hour. We do not want to schedule a trigger for every one hour as most of the files are taking less than 5 minutes. We want to automate this whole process which picks each file sequentially after the completion of loading. Is there a way where we can build a pipeline so that the pipeline will pick each file in order without manual intervention? If yes, please guide me clearly with every step.

Azure SQL Database
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,290 questions
0 comments No comments
{count} vote

Accepted answer
  1. Alberto Morillo 34,446 Reputation points MVP
    2022-12-21T15:31:55.893+00:00

    If you put all the files on an Azure Storage Account you can use the For each activity enables you to iterate on an array to perform actions like running a stored procedure on each item/file, but before that, you need to get the array of all the file names in the blob container, Get Metadata activity provides this capability. The below pipeline definition is an example:

    {  
        "name": "pipelineTest",  
        "properties": {  
            "activities": [  
                {  
                    "name": "Get Metadata1",  
                    "type": "GetMetadata",  
                    "typeProperties": {  
                        "dataset": {  
                            "referenceName": "YourAzureBlobDataset",  
                            "type": "DatasetReference"  
                        },  
                        "fieldList": [  
                            "childItems"  
                        ]  
                    }  
                },  
                {  
                    "name": "ForEach1",  
                    "type": "ForEach",  
                    "dependsOn": [  
                        {  
                            "activity": "Get Metadata1",  
                            "dependencyConditions": [  
                                "Succeeded"  
                            ]  
                        }  
                    ],  
                    "typeProperties": {  
                        "items": {  
                            "value": "@activity('Get Metadata1').output.childItems",  
                            "type": "Expression"  
                        },  
                        "activities": [  
                            {  
                                "name": "Stored Procedure1",  
                                "type": "SqlServerStoredProcedure",  
                                "typeProperties": {  
                                    "storedProcedureName": "[dbo].[StoredProcedureTestWithParameters]",  
                                    "storedProcedureParameters": {  
                                        "fileName": {  
                                            "value": {  
                                                "value": "@item().name",  
                                                "type": "Expression"  
                                            }  
                                        }  
                                    }  
                                },  
                                "linkedServiceName": {  
                                    "referenceName": "AzureSql1",  
                                    "type": "LinkedServiceReference"  
                                }  
                            }  
                        ]  
                    }  
                }  
            ]  
        }  
    }  
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.