When your pipeline fails on Azure DevOps and the source code is gathered from GitHub (using a service connection) you will notice a failure icon on the repository because the status of the run from Azure DevOps is reported to GitHub. This is the normal behavior and we want it to work like that.
Lets take as example the below run.
The failure will be visible on the github along with the particular commit.
However sometimes we need to allow tasks fail without reporting a failure state on GitHub. You can do that by using continueOnError keyword. With this functionality you instruct the DevOps platform to allow failure for a particular task or job without stopping the pipeline.
The below code can be used as a starter entry point for your DevOps pipelines. It is designed with best practices in mind with stages and jobs in order to isolate different functionalities and make it modular. You can include more stages,jobs,tasks by copy and pasting the code.
- stage: stage1
displayName: display name for your stage
- job: job1
displayName: display name for job1
- script: echo job1.task1
displayName: running job1.task1
- job: job2
displayName: display name for job2
- script: echo job2.task1
displayName: running job2.task1
On Azure devops you have the option to create both build and release pipelines. The build pipelines can be created using entirely the .yml notation in comparison with the release pipelines which should be created using a GUI. Build and release pipelines have their differences when it comes to approvals.
For release pipelines in order to create an approval flow you need to navigate in the stage and click the thunder strike. There you can locate the pre-deployment approvals and also gates that can be configured for that stage.
You can also define post-deployment approvals by clicking the person icon on the stage.
On the other hand in order to create approvals on build pipelines you will need to first create an environment. From environments you need to create a new blank environment
Then you need to navigate inside the environment and select approvals and checks
The last step would be to create a deployment job through YAML and point that environment. Every job which is created as deployment and has the environment configured will go through the approvals configured.