I am deploying the ADF ARM template from DEV instance to PROD using Azure DevOps pipelines.
For the deployment below are the steps I followed.
- Scripts provided by Microsoft to stop the triggers before deployment
- ARM template deployment
- Scripts provided by Microsoft to start the triggers and delete the resources not in the JSON file. under the header Sample pre- and post-deployment script in below page https://docs.microsoft.com/en-us/azure/data-factory/continuous-integration-deployment
I do have around 20 triggers in which 15 are in running state and 5 are stopped for a while in PROD. In my DEV instance all triggers are in stopped status in order to avoid unnecessary pipeline runs. But at the time of deployment into PROD I need to set status of 15 out of 20 triggers as Started.
To achieve this I have added the runtimeState of triggers in template parameterization and now I could select the trigger status from Override Parameters Option in the ARM Template Deployment task as below.
Now the issue is after PROD deployment, All triggers are in Stopped status only as in DEV instance.
Eventhough the runtimeState is overwritten at the time of deployment, it is not reflecting in the PROD instance after deployment.
After my analysis, I suspect the issue is with start trigger script from Microsoft is referring the ARMTemplateForFactory.json file from DEV where status of all triggers are stopped.
How to resolve this? I have to update the trigger status of each trigger job at the time of deployment from DEV to PROD.
In the script to STOP/START triggers from Microsoft, it is getting list of triggers to be started from Json file which we get from DEV instance through build pipeline. The overwritten pipeline status will not be taken to start the triggers.
One of the solution I found was to start the triggers explicitly after the ARM deployment. For that I found an agent job as shown below.
But the Issue with this job is I am not able to provide name of multiple triggers at a time. I am able to provide name of a single trigger as shown below.
Is there any way to add multiple trigger name in this job?