title: How to prevent triggering an Azure DevOps build pipeline based on commit tags?
body: <p>I am using Azure pipelines with a Github-based project. I have set up a build pipeline that is triggered only by tagged commits, to keep it separate from automatic daily builds that happen at every commit.</p>
  
  <p>I would like to exclude tagged commits from triggering the daily build pipeline. What is the correct way to do so in a yaml script?</p>
  
  <p>Here is what I did, without success.</p>
  
  <p>According to Azure documentation at <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=azure-devops&amp;tabs=yaml" rel="noreferrer">this page</a>, to my understanding excluding tags should be possible with something like:</p>
  
  <pre><code>trigger:
    tags:
      exclude:
      - projectname_v*
  </code></pre>
  
  <p>However, this does not work, and just prevents the build pipeline to run at any commit, be it tagged or not.</p>
  
  <p>I have also tried:</p>
  
  <pre><code>trigger:
    tags:
      include:
      - *
      exclude:
      - projectname_v*
  </code></pre>
  
  <p>but this is apparently not supported, as it produces error:</p>
  
  <pre><code>/azure-pipelines.yml: (Line: 12, Col: 7, Idx: 220) - (Line: 12, Col: 8, Idx: 221): While scanning an anchor or alias, did not find expected alphabetic or numeric character.
  </code></pre>
  
  <p>I have also tried the alternative syntax proposed on the doc page:</p>
  
  <pre><code>trigger:
    branches:
      exclude:
        refs/tags/{projectname_v*}
  </code></pre>
  
  <p>as well as variants with/without braces and wildcards, but all fail with "unexpected value" or "Input string was not in a correct format" errors.</p>
  
  <h2>Edit 2019-12-10</h2>
  
  <p>After reading wallas-tg's answer below, I have tried the following in the daily build pipeline:</p>
  
  <pre><code>trigger:
    branches:
      include:
      - '*'
      exclude:
      - 'refs/tags/*'
  </code></pre>
  
  <p>This works, but does not do what I would like:</p>
  
  <ul>
  <li>Pushing only a tag triggers the correct pipeline and not the one for daily builds</li>
  <li>Pushing a commit without tags triggers the daily build pipeline</li>
  <li>Pushing a tagged commit triggers both pipelines: the daily build pipeline gets triggered by the commit, and the other one by the tag; my desired behavior in this case would be that the daily build pipeline is not triggered.</li>
  </ul>