Azure数据工厂V2:部署后自动启动触发器?

时间:2018-08-22 14:14:02

标签: templates deployment triggers factory

我创建了一个管道和一个触发器,并且试图使触发器在部署后立即自动启动。 我在文档中看到,部署后触发器的状态为“停止”,我想问一下如何在模板部署中更改该状态,以便在每次部署后都不需要立即使用Powershell脚本。

我尝试在TD中使用“ runtimeState”参数,但已将其替换为“ stopped”。

这是我的触发器:

 {
      "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'))]"
      ]
    },

1 个答案:

答案 0 :(得分:2)

尚不支持, https://github.com/MicrosoftDocs/feedback/issues/1583

” 对问题进行调查后,很遗憾,无法创建激活的触发器。 ARM模板仅支持PUT操作,但是start是一个单独的POST操作。要激活触发器,必须在创建后通过UX,Powershell或使用的任何ADF SDK显式调用启动API。这是因为运行时状态是用户无法明确设置的只读属性。 “