'How to send SonarQube report to developers whenever the Azure DevOps build succeeded or failed

I have integrated the SonarQube tasks in Azure DevOps build pipeline. I can be able to successfully the scan my application source code using SonarQube.

I want to share the SonarQube report to Developers whenever the Sonar build succeeded or failed.



Solution 1:[1]

For notification settings, first of all, you need to have mail server or you can use popular ones (Gmail and etc.). Have a look at the below article for the every step you need to perform ;

https://www.fosstechnix.com/sonarqube-email-notifications/

Another possible way is if you have limitations in the Sonarqube server;

  1. Create quality gate in Sonarqube based on your profile https://docs.sonarqube.org/latest/user-guide/quality-gates/
  2. Use following plugin to break your pipeline in case of code were not passed the gate https://marketplace.visualstudio.com/items?itemName=SimondeLang.sonar-buildbreaker
  3. Create mail notification in Azure Devops to send notification when build failed because of Sonarqube quality gate; https://docs.microsoft.com/en-us/azure/devops/notifications/about-notifications?view=azure-devops#team-and-project-level-notifications

And as shown below you will see the reason about why pipeline build failed in the mail

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1