yaml - Scheduled Azure Devops Pipeline from BitBucket Cloud not triggering - Stack Overflow

I have a Bitbucket Cloud repo and I have integrated it with Azure Devops for running CICD automations (

I have a Bitbucket Cloud repo and I have integrated it with Azure Devops for running CICD automations (scheduled and PR events triggered). I have one scheduled pipeline as .yml file in the repo and I have created/configured it from the Azure Devops web GUI. The problem is that the pipeline does not trigger; I have tried to go through troubleshooting documentation without success. I've written a couple of different versions of the pipeline but unfortunately both are not triggering.

trigger: none # Disable standard trigger
pr: none # Disable PR trigger
schedules:
  - cron: "0 0 * * *" # Runs at 00:00 UTC every day
    branches:
      include:
        - develop

or

trigger:
  branches:
    exclude:
      - '*'
pr:
  branches:
    exclude:
      - '*'
schedules:
  - cron: "0 0 * * *" # Runs at 00:00 UTC every day
    branches:
      include:
        - develop
    always: true

Just as additional info:

  • in the repo there is a branch named develop
  • the pipeline is not running on default Azure Devops agents/runners but is running on ad hoc configured Managed Devops Pool agents (and pipeline based on PR events work fine there)
  • there is no web UI triggers (created from web GUI)
  • time zone conversion is fine, I know pipelines are UTC based
  • if I try validating the pipeline (from web GUI) I get it is valid

The final strange thing is that if I configure scheduled run settings from the web GUI, the pipeline triggers; the docs says that in case both configurations (GUI based and yml based) are set, the GUI based takes precedence, but in my initial scenario I had only the yml based trigger (no UI trigger) and it does NOT trigger at all.

I have a Bitbucket Cloud repo and I have integrated it with Azure Devops for running CICD automations (scheduled and PR events triggered). I have one scheduled pipeline as .yml file in the repo and I have created/configured it from the Azure Devops web GUI. The problem is that the pipeline does not trigger; I have tried to go through troubleshooting documentation without success. I've written a couple of different versions of the pipeline but unfortunately both are not triggering.

trigger: none # Disable standard trigger
pr: none # Disable PR trigger
schedules:
  - cron: "0 0 * * *" # Runs at 00:00 UTC every day
    branches:
      include:
        - develop

or

trigger:
  branches:
    exclude:
      - '*'
pr:
  branches:
    exclude:
      - '*'
schedules:
  - cron: "0 0 * * *" # Runs at 00:00 UTC every day
    branches:
      include:
        - develop
    always: true

Just as additional info:

  • in the repo there is a branch named develop
  • the pipeline is not running on default Azure Devops agents/runners but is running on ad hoc configured Managed Devops Pool agents (and pipeline based on PR events work fine there)
  • there is no web UI triggers (created from web GUI)
  • time zone conversion is fine, I know pipelines are UTC based
  • if I try validating the pipeline (from web GUI) I get it is valid

The final strange thing is that if I configure scheduled run settings from the web GUI, the pipeline triggers; the docs says that in case both configurations (GUI based and yml based) are set, the GUI based takes precedence, but in my initial scenario I had only the yml based trigger (no UI trigger) and it does NOT trigger at all.

Share Improve this question edited Mar 10 at 13:05 bryanbcook 18.9k2 gold badges47 silver badges79 bronze badges asked Mar 8 at 19:36 Giacomo PirinoliGiacomo Pirinoli 5687 silver badges19 bronze badges 2
  • What branch is this yaml defined in, and what is the default branch for the repository? – bryanbcook Commented Mar 9 at 15:49
  • It is defined in develop and the default branch for the repo is main. – Giacomo Pirinoli Commented Mar 9 at 21:10
Add a comment  | 

2 Answers 2

Reset to default 1

According to official doc Scheduled triggers.

If your YAML pipeline has both YAML scheduled triggers and UI defined scheduled triggers, only the UI defined scheduled triggers are run. To run the YAML defined scheduled triggers in your YAML pipeline, you must remove the scheduled triggers defined in the pipeline settings UI. Once all UI scheduled triggers are removed, a push must be made in order for the YAML scheduled triggers to start being evaluated.

After removing the scheduled triggers from UI, make some changes to your YAML file in your develop branch and push the changes. For example, add a comment line.

#Test

trigger: none # Disable standard trigger
pr: none # Disable PR trigger
schedules:
  - cron: "0 0 * * *" # Runs at 00:00 UTC every day
    branches:
      include:
        - develop

Then go back to your pipeline run list, click More actions -> Scheduled runs. You will be able to see the scheduled runs and the pipeline will run as expected.

I had some experiments in the last days, this being the sequence of actions performed:

  • new scheduled pipeline .yml file pushed to develop (no matter if through PR or through direct push)

  • pipeline created from Azure Devops on develop through web GUI (without setting UI triggers)

  • outcome: pipeline not triggered (and indeed no scheduled runs visible from ...->Scheduled runs)

Then I've gone through two different scenarios:

  • Scenario1:

    • update of already existing .yml file on develop

    • outcome: pipeline triggered (and indeed scheduled runs visible from ...->Scheduled runs)

  • Scenario2:

    • new scheduled pipeline .yml file pushed to tempbranch (no matter if then opening a PR or not)

    • pipeline created from Azure Devops on tempbranch through web GUI (without setting UI triggers)

    • outcome: pipeline not triggered (and indeed no scheduled runs visible from ...->Scheduled runs)

    • tempbranch merged into develop

    • outcome: pipeline triggered (and indeed scheduled runs visible from ...->Scheduled runs)

The disappointing aspect is that even without configuring any UI trigger (and by default a newly created pipeline comes with no UI triggers) you are forced to trivially update your .yml file (through a direct push or merge-push) otherwise the pipeline does not trigger.

This is somehow confirmed by @Ziyang Liu-MSFT, but the big difference is that in his/her answer the scenario of UI triggers removal is described, but that's not my case, since for my pipeline no UI triggers have ever been created/configured.

So to summarize: after creating the pipeline from web GUI you must always update it; in this sense, if adding it through a PR, it is better to create it on Azure Devops web GUI before merging the PR (otherwise you have to update it later).

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744887250a4599193.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信