Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to separate approvals of multiple jobs

I have a release pipeline that consists of two jobs, for QA and Production. Each job has a corresponding environment:

jobs:
- deployment: QA
  displayName: QA Deployment
  environment: QA
...
- deployment: Production
  dependsOn: QA
  displayName: Production Deployment
  environment: Production
...

And each environment is set to request an approval:

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I expected to have a separate approval for each job, i.e. to be able to approve the QA job and run it, and not to have to approve the Production job. But for some reason, I am not able to run the QA job without approving both QA and Production. So I can run either both jobs or none. What am I doing wrong, and how can I fix this?

>Solution :

According to the documentation, approval should be applied to stages. You should have a separate stage with deployment jobs for each environment.

enter image description here

Try:

stages:
- stage: QA
  jobs:
  - deployment: QA
    displayName: QA Deployment
    environment: QA
- stage: Production
  jobs:
  - deployment: Production
    dependsOn: QA
    displayName: Production Deployment
    environment: Production
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading