【问题标题】:Azure Data Factory V2: auto-start trigger upon deployment?Azure 数据工厂 V2:部署时自动启动触发器?
【发布时间】:2018-08-22 14:14:01
【问题描述】:

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

我尝试在我的 TD 中使用“runtimeState”参数,但它被替换为“已停止”。

这是我的触发器:

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

【问题讨论】:

  • 有人吗?触发器似乎是数据工厂 V2 的一个新特性。在 V1 中,它是在部署管道时自动进行的。
  • 同样的问题,也尝试设置“runtimeState”但无济于事。 ARM 文档也没有提及任何表明这是可能的内容:-/ 只找到了这些 powershell cmdlet 来启用它:docs.microsoft.com/en-us/powershell/module/az.datafactory/… 虽然很想在 ARM 模板中执行此操作...

标签: templates deployment triggers factory


【解决方案1】:

目前还不支持, https://github.com/MicrosoftDocs/feedback/issues/1583

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

【讨论】:

    【解决方案2】:

    您可以改用一点PowerShell 或通过 ARM 模板将 endTime 属性设置为过去的某个值(但不是在 startTime 之前)以禁用它,并设置为将来的某个值以启用它。

    【讨论】:

      猜你喜欢
      • 2018-05-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-02
      • 2018-10-02
      • 2021-11-23
      • 1970-01-01
      相关资源
      最近更新 更多