Multi-Stage Azure Pipeline with a path trigger - first stage always runs
Your pipeline runs for pull requests not because of the trigger, but because of a build validation policy you've set for one or more target branches (&quot;whenever I create a PR to this branch, start this pipeline&quot;). It's the build validation, as part of a branch's policies: https://docs.microsoft.com/en-us/azure/devops/repos/git/branch-policies?view=azure-devops#build-validation
You probably didn't specify a path filter in the build validation settings. Here's an example of three different build validations in a single branch policy, all with different path filters:

In short: The path trigger in your YAML has no effect on how a pipeline is triggered for a PR. The trigger you've specified is one that triggers on commits to the master branch, if the commit includes files in the terraform directory.