title: How to differentiate between branch trigger and the scheduled trigger in azure DevOps build pipeline
body: <p>I want to run different jobs in build pipeline for branch trigger and scheduled trigger.</p>
  
  <p><code>branch trigger =&gt; run job 1</code></p>
  
  <p><code>scheduled trigger =&gt; run job 2</code></p>
  
  <p>Is there any way to <strong>differentiate between the triggers</strong>? So that i will be running my jobs according to that differentiating condition.</p>
  
  <p><strong>My thought process</strong></p>
  
  <p>I was thinking of setting variable during scheduled trigger, hence i could use that variable in the job condition evaluation. But I was not able set the variable.</p>
  
  <pre><code># Sample azure-build-pipeline.yml file
  
  
  variables:
  
  # by default the variable is false
    isScheduledTrigger: false
  
  
  trigger:
    - develop
    - master
  
  schedules:
    - cron: "0 0 * * *"
      displayName: Daily midnight build
      branches:
        include:
          - develop
      always: true
  # somewhere here i want to set the isScheduledTrigger variable to TRUE
  
  jobs:
   - job: Branch trigger job
     condition: or(eq(variables['Build.SourceBranchName'], 'develop'),eq(variables['Build.SourceBranchName'], 'master'))
     steps:
  # Multiple steps for branch trigger
  
  
  
  - job: Scheduled trigger job
     condition: and(eq(variables['Build.SourceBranchName'], 'develop'),eq(variables['isScheduledTask'], True))
     steps:
  # Multiple steps for scheduled trigger
  
  
  </code></pre>