<p>No, there's no such thing as a 'before' setting or anything like it.</p>
<p>There are only two ways of configuring job dependencies:</p>
<ol>
<li>don't define dependsOn at all: this is an easy way to let the pipeline run the jobs one after another, but doesn't let you use advanced features</li>
<li>define dependsOn for each job: this is more complicated (as you've found out) but allows fine-grained control and extra features such as reusing output variables</li>
</ol>

CC BY-SA 4.0
2022-02-21T21:06:58.147Z
2022-02-21T21:06:58.147Z
Vince Bowdren
<p>In azure-pipelines one can use <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops" rel="nofollow noreferrer">dependsOn</a> to indicate what jobs or deployments should be completed before another job will be started.</p>
<p>At the moment, the dependsOn array of the final job has to be added everytime if some job is added.</p>
<p>The question is whether it is possible to define a sort of <code>before</code> expression to ensure that this only has to be defined once in a azure-pipeline template.</p>

<azure-pipelines>
Equivalent of dependsOn in azure-pipelines?
030
# Equivalent of dependsOn in azure-pipelines?

(Asked by: username_0 on 2022-02-17)

In azure-pipelines one can use [dependsOn](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops) to indicate what jobs or deployments should be completed before another job will be started.

At the moment, the dependsOn array of the final job has to be added everytime if some job is added.

The question is whether it is possible to define a sort of `before` expression to ensure that this only has to be defined once in a azure-pipeline template.

**Tags:** azure-pipelines


---

## 1 answers

### Answer by username_1 on 2022-02-21. Score: 2 | Accepted answer

No, there's no such thing as a 'before' setting or anything like it.

There are only two ways of configuring job dependencies:

1. don't define dependsOn at all: this is an easy way to let the pipeline run the jobs one after another, but doesn't let you use advanced features
2. define dependsOn for each job: this is more complicated (as you've found out) but allows fine-grained control and extra features such as reusing output variables


---

