AWS/Azure/OpenShift/Kubernetes Version Control System (VSC)

How to configure email notifications for Azure CI/CD build Pipeline on Azure DevOps Project

header-picture-1

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 first step guide to how you can setup your Azure DevOps Account, starting from signing up for Azure DevOps as a new user, 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 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.

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 to enable email notifications at the organization level?

The following steps explain this;

  1. Sign in to your organization {https://dev.azure.com/{yourorganization}
  2. Create new organization or select organization settings if there is an existing organization as show on the screenshot below.
31.08.2021_04.47.56_REC
Azure DevOps Organization

3. Select Global notification and new subscription as shown below:

Create-new-email-subscrition-at-the-organization-level

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.

inputs-for-email-customization-field
Email notifications Preference

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.

selecting-users-or-groups
selecting-default-users-or-groups

How to enable email notifications at the Project level?

  1. Sign in to your organization (https://dev.azure.com/{yourorganization})
  2. Select organization ->project
Select-organization-and-project
Organization – project selection

3. Select Project settings -> Notifications ->New subscription

Project-Settings
Project setting

4. Under the category tab, select Build -> select A build completes or A build fails depending on your preference

31.08.2021_05.53.42_REC

5. Click Next

6. Select Custom email address in the Deliver to dialog box

31.08.2021_05.56.02_REC

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.

31.08.2021_05.58.34_REC

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.

Turning-off-Notification

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.

View-and-edit-notification

That is it with configuring email notifications for your build pipeline or any other activities within your Azure DevOps organization and project.

Watch out for more guides this month!!

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x