<p>You can define multiple stages in a release pipeline. Each stage (i.e. Dev, Prod) can have its own set of tasks and/or other factors that differ. If you want the same set of tasks, you can duplicate a stage then change what's needed. Alternatively, you can configure the tasks using pipeline variables. The variables can be defined to have different values based on the stage scope (or applicable to the release scope). This way, each stage is essentially the same set of tasks but at runtime each behaves differently based on the variable values applicable to it at runtime.</p>
<p>See the MS docs on stages based on your pipeline type preference:</p>
<ul>
<li><a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/stages?view=azure-devops&amp;tabs=yaml" rel="nofollow noreferrer">YAML</a></li>
<li><a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/stages?view=azure-devops&amp;tabs=classic" rel="nofollow noreferrer">Classic</a></li>
</ul>

CC BY-SA 4.0
2020-06-20T14:10:40.567Z
2020-06-20T14:10:40.567Z
Peter
<p>I have a visual studio database project being built and released through Azure DevOps.</p>

<p>I need to execute a different post deployment for Dev vs. Prod.</p>

<p>Is there a way to achieve this either through the release pipeline or the visual studio project?</p>

<azure-devops><azure-pipelines><sql>
Azure DevOps Different Post Deployment script per environment
Adrian S
# Azure DevOps Different Post Deployment script per environment

(Asked by: username_0 on 2020-06-01)

I have a visual studio database project being built and released through Azure DevOps.

I need to execute a different post deployment for Dev vs. Prod.

Is there a way to achieve this either through the release pipeline or the visual studio project?

**Tags:** azure-devops, azure-pipelines, sql


---

## 1 answers

### Answer by username_1 on 2020-06-20. Score: 1

You can define multiple stages in a release pipeline. Each stage (i.e. Dev, Prod) can have its own set of tasks and/or other factors that differ. If you want the same set of tasks, you can duplicate a stage then change what's needed. Alternatively, you can configure the tasks using pipeline variables. The variables can be defined to have different values based on the stage scope (or applicable to the release scope). This way, each stage is essentially the same set of tasks but at runtime each behaves differently based on the variable values applicable to it at runtime.

See the MS docs on stages based on your pipeline type preference:

* [YAML](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/stages?view=azure-devops&tabs=yaml)
* [Classic](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/stages?view=azure-devops&tabs=classic)


---

