fopa
fopa

Reputation: 21

What are the options to visualize code metrics from Azure DevOps build?

I have set up a build pipeline Azure DevOps, which builds the project, runs the MSTests and generates code coverage report as well as code analysis metrics results.

How do I get these results to a dashboard such as Power BI or any similar? What are the different visualization options from Azure DevOps?

I know adding a widget and getting the visualization in a Azure DevOps dashboard, but looking for an option where I can publish the results, also see the historic code metrices, and drill down to each class level results.

Upvotes: 1

Views: 1186

Answers (2)

fopa
fopa

Reputation: 21

I got the metrics xml files to a blob storage from the pipeline and then added the blob storage as data source to power BI. Did necessary transformations in Power BI and published the report to PowerBI dashboard which gave me required report and made it accessible to people in the organization.

Upvotes: 0

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31075

You can check the sample reports in the following link:

https://learn.microsoft.com/en-us/azure/devops/report/powerbi/sample-odata-overview?view=azure-devops

For example, you can paste the Power BI query listed below directly into the Get Data->Blank Query window.

let
   Source = OData.Feed (""
in
    Source
                &"Pipeline/PipelineName eq '{pipelineName}' "
                &"And Date/Date ge {startdate} "
        &"And Workflow eq 'Build' "
        &") "
            &"/aggregate( "
                &"ResultCount with sum as ResultCount, "
                &"ResultPassCount with sum as ResultPassCount, "
            &"ResultFailCount with sum as ResultFailCount, "
                &"ResultNotExecutedCount with sum as ResultNotExecutedCount, "
            &"ResultNotImpactedCount with sum as ResultNotImpactedCount "
        &") "
    ,null, [Implementation="2.0",OmitValues = ODataOmitValues.Nulls,ODataVersion = 4]) 
in
    Source

Upvotes: 1

Related Questions