ARM Template to create schedule trigger in ADF

AzeemK 511 Reputation points
2020-12-18T05:56:18.017+00:00

I am creating a basic ARM Template in ADF V2 to create triggers , I am new to ARM templates and slowly adding stuff to my template
below , my pipeline input source is on Prem SQL tables which I am pulling through dataset and linked Service what do I put in parameters for input path below code, my out is ADLS Gen 2

{
"properties": {
"name": "MyTrigger",
"type": "ScheduleTrigger",
"typeProperties": {
"recurrence": {
"frequency": "Hours",
"interval": 24,
"startTime": "2020-12-18T17:15:00Z",
"endTime": "2020-12-18T18:17:00Z",
"timeZone": "UTC"
}
},
"pipelines": [{
"pipelineReference": {
"type": "PipelineReference",
"referenceName": "MCF_PipeLine_Segment"
},
"parameters": {
"inputPath": "LS_MCFMemberAccess",
"outputPath": "@markus.bohland@hotmail.de ('MCF(Segments)/',formatDateTime(utcnow(), 'yyyy'),'/',formatDateTime(utcnow(), 'MM'))"

}
}
]
}
}

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
7,977 questions
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA-MSFT 65,761 Reputation points Microsoft Employee
    2020-12-18T10:53:12.387+00:00

    Hello @AzeemK ,

    Thanks for the ask and also for using the Microsoft Q&A forum.

    what do I put in parameters for input path below code?

    You can add a parameter to your pipeline and then you can edit the JSON file of your trigger.

    For more details, refer How to pass parameters to an ADF pipeline from Schedule type trigger?.

    OR

    The pipeline takes two parameters values: inputPath and outputPath. And you pass values for these parameters from the trigger.

    {  
        "properties": {  
            "name": "MyTrigger",  
            "type": "ScheduleTrigger",  
            "typeProperties": {  
                "recurrence": {  
                    "frequency": "Minute",  
                    "interval": 15,  
                  "startTime": "2020-12-18T17:15:00Z",  
                 "endTime": "2020-12-18T18:17:00Z",  
                    "timeZone": "UTC"  
                }  
            },  
            "pipelines": [{  
                    "pipelineReference": {  
                        "type": "PipelineReference",  
                        "referenceName": "Adfv2QuickStartPipeline"  
                    },  
                    "parameters": {  
                        "inputPath": "adftutorial/input",  
                        "outputPath": "adftutorial/output"  
                    }  
                }  
            ]  
        }  
    }  
    

    Reference: Create a trigger that runs a pipeline on a schedule.

    Hope this helps. Do let us know if you any further queries.

    ------------

    • Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Nasreen Akter 10,671 Reputation points
    2020-12-18T14:09:47.673+00:00

    Hi @AzeemK ,

    Thank you for asking this question. Probably you know all of this but wanted to clarify few things:

    First: when you add a new Trigger (create), you only need to provide trigger related information e.g., trigger type, when the trigger will start running, how frequent the trigger will run.

    Now after creating a trigger, you can associate one or multiple pipelines to that trigger. That means when the trigger will run, it will fire/execute the associate pipelines attached to it.

    Now when you add trigger to any pipeline, at that time you have to provide pipeline parameters information. You do not have to pass the linked service information (because that information are already mentioned in the Dataset) only the values for the pipleine parameters (if you have any). From the screenshot you provided, I see that in pipeline "MCF_PipeLine_Segmen", you are passing two parameters inputPath, OutputPath. You can pass string values along with other type and also you can pass expression like you did for "outputPath": "@markus.bohland@hotmail.de ('MCF(Segments)/',formatDateTime(utcnow(), 'yyyy'),'/',formatDateTime(utcnow(), 'MM'))".

    Lastly: for the ARM template, ADF take care of the ARM template. When you publish your changes, ARM template for the DataFactory automatically get created/updated. You can download the ARMTemplate from the top icon ARM template --> Export ARM template.

    Hope this helps. If it does, please don't forget to "accept the answer" and "up-vote"! Thank you!

    0 comments No comments

  2. AzeemK 511 Reputation points
    2020-12-18T16:48:24.407+00:00

    I have created a new trigger why is this not showing up in my TRIGGER RUNS under schedule , it does show up in Pipeline runs , I want o schedule it not run manually every time see screen shots below it should show up in second screen shot under trigger runs
    also can I exp49480-trigger.jpg49535-trigger-schedule.jpgort trigger as ARM template so I can modify it for different pipelines and import it back