This can be done using Cron Job or Cron Expressions.
There are two things you need to consider :
- The pipeline that is already created is - MyRelease Pipeline.
- The new Pipeline - Scheduler Pipeline.
Azure DevOps page > Pipelines > Choose Pipelines.
A new pipeline window appears and then click on the new pipeline button in the new window.
- Choose Azure Repos Git as your source.
You will be asked to choose your source of code and select Azure Repos Git as your source.
Choose the location for your YAML file to be saved.
After completing the above step, a template window will appear, In that choose Start pipeline from the list.
Azure DevOps YAML pipeline comes with an assistant, This helps you fill the required details in the text box and, It will be added as a YAML script.
YAML
schedules:
- cron: "0 2 1-7 * SUN"
displayName: 25th 5:30 AM (IST) Every Month
branches:
include:
- master
- Edit your YAML file according to your preference.
For scheduling, the code will look like this :
schedules:
- cron: "0 2 1-7 * SUN"
displayName: 25th 5:30 AM (IST) Every Month
branches:
include:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- task: releaseorchestrator@2
inputs:
endpointType: 'integrated'
projectName: 'My Project'
definitionName: 'MyRelease Pipeline'
releaseStrategy: 'create'
definitionStage: 'Staging'
Hope this helps you.