-
Hey, We have a case where we are deploying the code to dev(live), test and prod environment. The necessary triggers are started in source control. After deployment to dev and to test we would like the stop the triggers in these environments, since we want people to run the pipelines that they need on demand, and we do not want these pipelines to run on their schedule and incur costs. Whereas deployment to prod should keep the triggers as they are defined in source control. What is the recommended way to achieve this? We are using Azure DevOps pipelines where the deployment to each environment has their own template deployment file. At the moment we are using the PrePostDeploymentScript.Ver2 together with AzureResourceManagerTemplateDeployment@3 Later edit: $opt = New-AdfPublishOption
$opt.TriggerStartMethod = KeepPreviousState Then when new triggers are published they are published as stopped, and unless explicitly started in the dev and test environment, they will remain stopped with each deployment. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello @Liszet. Also, the other parameter works very well along with the above one and speeds up the process: |
Beta Was this translation helpful? Give feedback.
Hello @Liszet.
I see that you already found an appropriate feature of ADFTools for your case.
So what I can do is confirm, yes, that this is the best approach:
TriggerStartMethod
- determines which triggers should be started.For DEV/TEST/QA environment set
KeepPreviousState
optionFor PROD environment select
BasedOnSourceCode
for the deployment.Also, the other parameter works very well along with the above one and speeds up the process:
TriggerStopMethod
- determines which triggers should be stopped.Set up
DeployableOnly
option, which will ignore unchanged started triggers.