Open garddolau opened 1 year ago
@garddolau you should set use_yaml=false
otherwise the the pipeline trigger will use the triggers defined in the YML.
ci_trigger {
use_yaml = true
}
Hi @xuzhang3, just tried with use_yaml = false. I can that reflect in the portal. Unfortunately it still never triggered on the set schedule. Regards Darren
@garddolau my pipeline triggered as scheduled. Is there any error logs or can run the pipeline manually?
We have the same issue. Investigating whether there is a behind the scenes attribute somewhere. Very annoying as we create 100s of pipelines using TF.
Hi,
I've run into this problem as well, but in my case, some scheduled pipelines work and some don't. I think the reason some work is: The pipeline definition was created with a ci_trigger { overrides = { batch = true}} and then they were updated to ci_trigger { use_yaml = false } are scheduled and run correctly. The pipelines that are created directly using ci_trigger { use_yaml = false } have a schedule but are not run.
Looking at https://learn.microsoft.com/en-us/azure/devops/pipelines/process/scheduled-triggers?view=azure-devops&tabs=yaml#batch-considerations-for-scheduled-triggers I think that the option to always run needs to be added to the provider to fix this.
According to the yaml https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/schedules-cron?view=azure-pipelines the always = true needs to be set.
I will continue to investigate the Azure Devops API response to see if I can verify this.
Hi,
I have spent a couple of hours with Azure DevOps support and testing this behaviour. I can confirm that when you create a scheduled run using Terraform it is created but never run. If I update the existing schedule and move the run time 10 minutes forward, it works. The same behaviour exists if I update the schedule using Terraform or the Azure DevOps web interface.
I'm not a Go developer but it looks like there is a difference in how the API is called when creating or updating an existing build definition.
Add skip_first_run=false
to ensure the pipe will be triggered after created
features {
skip_first_run = false
}
More details: https://registry.terraform.io/providers/microsoft/azuredevops/latest/docs/resources/build_definition#skip_first_run-1
Community Note
Terraform (and Azure DevOps Provider) Version
Terraform v1.3.1 on windows_amd64
microsoft/azuredevops version 0.3.0
Affected Resource(s)
azuredevops_build_definition
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
When setting a schedule, it should activate and run on the time set
Actual Behavior
When setting a schedule, it never runs. You can see the scheduled set fine within Azure DevOps GUI and is set to run on expected time. But it never actually runs, If you make a change to it manually via GUI or make an amendment and rerun terraform to update it does then run as expected
Steps to Reproduce
terraform apply
Important Factoids
References
0000