Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Data Factory V2: auto-start trigger upon deployment?

I created a pipeline and a trigger, and I'm trying to get the trigger to be auto-started right after deployment. I saw in documentation that after deployment the trigger's state is "stopped" and I want to ask how can I change that in my template deployment in order to not be needed to use powershell script right after every deployment.

I tried to use the "runtimeState" parameter in my TD but it was replaced to "stopped".

This is my trigger:

 {
      "name": "[concat(variables('factoryName'), '/periodicTrigger')]",
      "type": "Microsoft.DataFactory/factories/triggers",
      "apiVersion": "2018-06-01",
      "properties": {
        "description": "Periodic trigger for the backup pipeline.",
        "annotations": [],
        "runtimeState": "Started",
        "pipelines": [
          {
            "pipelineReference": {
              "referenceName": "[concat(variables('mainStorageName'),'backupPipeline')]",
              "type": "PipelineReference"
            },
            "parameters": {}
          }
        ],
        "type": "ScheduleTrigger",
        "typeProperties": {
          "recurrence": {
            "frequency": "Day",
            "interval": 1,
            "startTime": "2018-08-21T13:28:07.785Z",
            "timeZone": "UTC",
            "schedule": {
              "minutes": [
                0
              ],
              "hours": [
                3
              ]
            }
          }
        }
      },
      "dependsOn": [
        "[concat(variables('factoryId'), '/pipelines/',concat(variables('mainStorageName'),'backupPipeline'))]"
      ]
    },
like image 207
meniman Avatar asked Aug 22 '18 14:08

meniman


People also ask

What are the three types of trigger in ADF?

Azure Data Factory Triggers come in three different types: Schedule Trigger, Tumbling Window Trigger, and Event-based Trigger.

What is the difference between tumbling window trigger and schedule trigger?

The trigger used has a 5-minute recurrence interval. So, in this scenario both types of triggers behave in the same way. But tumbling window triggers have a self-dependency property which is not available with Schedule triggers.

How do I manually trigger Azure data/factory pipeline?

Trigger the pipeline manually Select Trigger on the toolbar, and then select Trigger Now. On the Pipeline Run page, select OK. Go to the Monitor tab on the left. You see a pipeline run that is triggered by a manual trigger.


1 Answers

It's not supported yet, https://github.com/MicrosoftDocs/feedback/issues/1583

" After investigating the issue, unfortunately there is no way to create an activated trigger. ARM templates only support PUT actions, but start is a separate POST action. To activate a trigger, you must explicitly call the start API either via UX, Powershell or whatever ADF SDK you are using after creation. This is due to runtime state being a readonly property that a user cannot explicitly set. "

like image 63
שלומי כהן Avatar answered Sep 28 '22 12:09

שלומי כהן