
When building your first CI/CD Pipeline on Azure DevOps, one of your responsibilities as the project administrator will be to manage notifications for a team, group, or organization so that can receive email notifications for each successful build or failure build pipeline. In my previous articles, I described very extensively how you can build your first CI/CD Pipeline in Azure DevOps using ASP.Net Core Application. If you haven’t read it yet, click here. Why do you need to read my previous article? The reason is to give you a first-step guide to how you can set up your Azure DevOps Account, starting from signing up for Azure DevOps as a new user, and creating your first Azure DevOps Organization to creating your first Azure DevOps Project, and running your Azure CI/CD Pipeline.
The steps mentioned are the first steps you need to get started with configuring email notifications for your project team for any build pipeline on Azure DevOps. There are two levels of notifications in Azure DevOps. They are:
- Notifications at the organization level and;
- Notification at the project level.
So if you disable email notifications for a particular project yet you still receive a build notification you need to also disable it at the organization level. Here are some related guides: Import repo to Bitbucket Cloud: How to import your project from Bitbucket Server or Bitbucket Cloud to GitLab, Azure DevOps and GitHub integration for Docker and Kubernetes deployment, how to create a static pod in Kubernetes, and how to install, register and start GitLab Runner on Windows.
Why Do you need to Enable email Notifications for your build Pipeline?
Who receives an email notification when a build pipeline is successful or failed must be properly configured. Not properly configured can result in your inbox receiving too many or few emails which could prevent you from knowing at the early stage if your CI/CD build pipeline is fine or not. The reason why you need to configure the email and add new custom email subscriptions, its delivery settings, delivery preferences, and other factors is because notifications help you and your team stay informed about activity that occurs within your projects in Azure DevOps.
You can get notified when changes occur to the following items:
- Build completes – Which reports the build is complete successfully
- Pull request reviewers added or removed – Notifies the team when it is added or removed as a reviewer for a pull request reviewer
- Pull request changes – Notifies the team when changes are made to a pull request
- Run stage waiting for approval – Notifies the team when a run stage approval is pending on them.
- Manual validation Pending – Notifies the team when a manual validation is pending on them.
- Manual intervention pending – Notifies the team when a manual intervention is pending on the team
- Deployment to an owned stage failed – Notifies the team when a deployment does not succeed and makes a stage that the team owns unhealthy
- Deployment to an approved stage failed – Notifies the team when a deployment team approved does not succeed
- Deployment completion failures – Notifies the team when a deployment team request does not succeed and run
- Deployment approval pending – Notifies the team when an approval for a deployment is pending on the team
How do enable email notifications at the organizational level?
The following steps explain this;
- Sign in to your organization {
https://dev.azure.com/{yourorganization}
- Create a new organization or select organization settings if there is an existing organization as shown in the screenshot below.
3. Select Global notification and new subscription as shown below:
4. Select a build completes
option – In this option, you will configure the email notification for the whole project or a specific project by selecting the radio button. I configured mine for my specific project. Under the Deliver to the dialog box, select Custom email. In the filtering section, you have the option to select the purpose for configuring the email notification, here I select Build reason. This will enable me and my team to be notified of any build that’s successful or fail.
5. Click Finish
to have it configured
Under the Azure DevOps organization settings, you can view the existing Subscribers
. In the screenshots shown below, I am the only existing subscriber.
How to enable email notifications at the Project level?
- Sign in to your organization (
https://dev.azure.com/{yourorganization}
) - Select organization ->project
3. Select Project settings -> Notifications ->New subscription
4. Under the category tab, select Build
-> select A build completes
or A build fails
depending on your preference
5. Click Next
6. Select Custom email address
in the Deliver to
dialog box
7. Complete the following steps as shown in the screenshot below based on your preference. As you can here, I’m particularly configuring the notification for A build completes
. Hence, why that is specified as the description. Of course, I’m configuring it for my specific project and this specific project is for all the people added as team members for the project named demoproject
. Looking through the Filter section, I have added more clause such as status
which and requested by.
8. Click Finish
and you’re good to go.
You can turn off notifications for subscribers by simply switching between the toggling button as shown on the screenshot below.
View and edit all notification subscriptions
This view shows all notification subscriptions that you’ve created or that were created by an administrator. Notification subscriptions let you control what you get notified about. Subscribed notifications are indicated with the State as On.
That is it with configuring email notifications for your build pipeline or any other activities within your Azure DevOps organization and project.