Can we do something like:
trigger:
paths:
include:
- $(ProjectName)/src/
variables:
ProjectName: foo
Is that supported?
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I don't recall off-hand if that works. This should, though:
trigger:
paths:
include:
- ${{ variables.ProjectName }}/src/
variables:
ProjectName: foo
(Only works because the variable is statically defined, though - if it was queue-time or computed somehow, it would not work.)
@vtbassmatt - Yes, it's a static variable.
However, when I tried your code I get an error message:
1183: "/LibraryA/azure-pipelines.yml (Line: 13, Col: 7): A template expression is not allowed in this context"
Any idea? Any other prerequisite to make this work?
D'OH! We don't allow expressions in triggers for mumble mumble reasons. There's not a good workaround for the scenario - sorry 😞 You mind filing a request at https://developercommunity.visualstudio.com/spaces/21/index.html ?
Sure, if it helps. :) Here you go: https://developercommunity.visualstudio.com/idea/717570/pipelines-support-variables-in-yaml-trigger-path-f.html
Can we add a note to the docs to reflect that it's not possible to use variables today?
Thanks for your question. It looks like your question isn't an issue with the documentation, but an issue or question specific to your implementation or a bug in the product itself.
For help with a specific task, here are a couple of options where you might consider asking your question:
If you've encountered an issue with the product itself, to make sure it gets in front of the right people, please submit your bug here.
If you have an idea for improving the product, please submit your idea here.
@mijacobs Did the docs get fixed/clarified as the outcome of this issue?
That primary intent of this issue was to make it clear in the docs what is/isn't supported today.
HI @NenoLoje,
I'm sorry, this issue was miscategorized; I've re-categorized and re-opened it.
This feature would be very helpful !!
This feature would be very helpful !!
Great. If you want it, make sure to add your vote at: https://developercommunity.visualstudio.com/idea/717570/pipelines-support-variables-in-yaml-trigger-path-f.html
That's where your voice counts. :)
Fix in progress
@vtbassmatt
I see this issue has been closed. Does that mean the fix is out?
And by chance would it also work for variables defined through the interface rather than in the yaml file?
The docs are fixed, reflecting the reality that variables and templates are not parsed in triggers.
Got it. Thank you!
friendly reminder for anyone else trying to achieve single consolidated yml file for multiple pipeline definitions...
we can set the triggers up at the GRAPHICAL pipeline settings (and then leave that out of the yml)

gathering all the links i found while looking:
Our branching strategy uses a new branch (Fork for Git guys) for every iteration and every release. We have dozens of builds, for each microservice and web portal. It is best for us to use a single release variable where we can change the path to the current iteration or release branch in one place instead of in each of the dozens of builds.
Most helpful comment
Can we add a note to the docs to reflect that it's not possible to use variables today?