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:
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.
Try:
stages:
- stage: QA
jobs:
- deployment: QA
displayName: QA Deployment
environment: QA
- stage: Production
jobs:
- deployment: Production
dependsOn: QA
displayName: Production Deployment
environment: Production

