Link to article:
https://docs.microsoft.com/en-us/azure/templates/microsoft.datafactory/2018-06-01/factories/triggers
Problem:
Whenever I create a scheduled trigger via AzureRM it ends up being deactivated, and I manually have to activate it via the ADFv2 GUI.
I tried via "runtimeState": "Started" but that didn't help either (seems to be a read-only property that is being set on API side but can't be set on client side)
Example AzureRM snippet:
{
"name": "[concat(variables('dataFactoryName'), '/nightly-trigger')]",
"type": "Microsoft.DataFactory/factories/triggers",
"apiVersion": "2018-06-01",
"properties": {
"annotations": [],
"runtimeState": "Started",
"pipelines": [
{
"pipelineReference": {
"referenceName": "[variables('pipelineName')]",
"type": "PipelineReference"
},
"parameters": {}
}
],
"type": "ScheduleTrigger",
"typeProperties": {
"recurrence": {
"frequency": "Hour",
"interval": 24,
"startTime": "2019-04-11T01:00:00Z",
"timeZone": "UTC"
}
}
},
"dependsOn": [
"[variables('dataFactoryId')]",
"[concat(variables('dataFactoryId'), '/pipelines/', variables('pipelineName'))]"
]
},
How can it be created in activated state?
Thank you for creating the issue! One of our team members will get back to you shortly with additional information. If this is a product issue, please close this and contact the particular product's support instead (see https://support.microsoft.com/allproducts for the list of support websites).
@tfitzmac Can you please take a look at this issue?
Hi there, apologies for the delayed response on this issue. The product team is currently investigating this and will have a response shortly
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.
Hi @djpmsft, thanks for elaborating!
Are there any plans to change that in the future, or is the current situation how it is intended to be?
I'm asking, because we are trying to do the whole deployment via ARM, but this introduces extra deployment scripts / steps required before and after ARM deployment of datafactories. From our experience so far with deploying Azure resources via ARM this seems to be quite uncommon, as for all other resources no extra steps were needed and they could be deployed just via the template.
This is intended. Starting and stopping triggers can affect long-running pipelines, we want users to explicitly start and stop them.
Thanks for clarification @djpmsft !
Most helpful comment
Hi there, apologies for the delayed response on this issue. The product team is currently investigating this and will have a response shortly