
Let's walk through each step and see how are they configured in Azure DevOps pipeline definition YAML file. To make things as simple as possible, I will only focus on unit tests project and omit the actual project publish code coverage results to Azure DevOps.


It is only required to reference it in unit tests project. It is important that you reference llector nuget package in your unit tests project. It is pretty much a matter of command line argument to get Coverlet format reports. This is not so hard considering Visual Studio Test Platform has Coverlet format data collector already integrated in it, so it comes pretty much out of the box. With Azure DevOps you need to do this step yourself, meaning that apart from generating the test results with the unit tests step (dotnet test) you need to generate the code coverage report (HTML) manually in the pipeline itself. With SonarCloud you only need to publish test results and it will do the reporting for you. NET Core you have to setup the reporting yourself. SonarCloud is only free for open-source projects, but if you have your private repository than you will have to pay for commercial tier.Īzure DevOps build pipeline has a code coverage option as well, but in order to have it work with. Although SonarCloud is a great platform for analyzing your code coverage and dry code analysis, it can add additional cost to your project. NET Core code analysis to SonarCloud from Azure build pipeline.

I while ago I wrote and article about Publishing.
