I've configured first deployment pipeline to an on-prem DEV environment. The project consists of 3 identical environments, DEV, UAT and PROD While their setup is exactly alike, their config (database credentials etc.) is obviously not.

I'm using the DevOps variables to alter web.config and appsettings.json configuration files while deploying. Therefore I'd like to apply the same deployment pipeline, targeting 3 different environments with 3 different variables sets.

This is the way I've seen in Octopus. Is it possible in the DevOps?

2 Answers 2


You can create a Release Pipeline with a stage for every environment; each stage has a different variable group, defining that environment's settings.
On each stage you can copy files, etc. and run tests against the environment.
If the test/stage succeeds, the pipeline goes ahead to the next stage. Between the stages, you can configure that an authorized person has to approve the next step.
The screenshot below is a release pipeline of one of my little side projects.

release pipeline with multiple stages

  • Yup, this is the best answer! Commented Nov 14, 2019 at 4:09
  • 2
    This doesn't address the variable aspect of the question
    – xtreampb
    Commented Nov 14, 2019 at 17:25

If I understand your question, you want a single variable to have different values per stage. This same concept Octopus took a while to get right with being able to manage the variables. Currently that isn't a thing that is available in Azure devops. You can create a pipeline that Ned Flanders suggested but you would need to define the variable multiple times for each environment and scope each variable to the stage it is deployed in. I think this is a need of azure devops and is one thing that octopus deploy does better than azure devops. I would recommend opening a feature request for this. Microsoft moved away from user voice and onto developer community. There is a request for this back in April that got closed in September due to low activity closed request. If you open up a new one, I'm sure we can get people here to vote on it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.