Pipeline outcome summary for all pipelines sample reports
Azure DevOps Services | Azure DevOps Server 2022 | Azure DevOps Server 2020
You can use the information provided in this article to query pipeline metrics--such as pass rate, number of failures, duration, and so on--for all pipelines and create a single report. Additional queries are provided to get other metrics, such as pipeline duration and number of failures for all project pipelines.
The following image illustrates the outcome summary for all pipelines defined for a project since September 2022.
As shown in the following image, you can select any pipeline from the Pipeline Name drop-down menu, and the report changes to focus on the outcome summary for the selected pipeline.
Important
Power BI integration and access to the OData feed of the Analytics Service are generally available for Azure DevOps Services and Azure DevOps Server 2020 and later versions. The sample queries provided in this article are valid only against Azure DevOps Server 2020 and later versions, and depend on v3.0-preview or later version. We encourage you to use these queries and provide us feedback.
Prerequisites
- Access level: You must be a member of a project with Basic access or higher.
- Permission: By default, project members have permission to query Analytics and create views.
- For more information about other prerequisites regarding service and feature enablement and general data tracking activities, see Permissions and prerequisites to access Analytics.
Note
This article assumes you've read Overview of Sample Reports using OData Queries and have a basic understanding of Power BI.
Sample queries
You can use the following queries of the PipelineRuns
entity set to create different but similar pipeline outcome summary reports.
Note
To determine available properties for filter or report purposes, see Metadata reference for Azure Pipelines. You can filter your queries or return properties using any of the Property
values under an EntityType
or NavigationPropertyBinding Path
values available with an EntitySet
. Each EntitySet
corresponds to an EntityType
. For more information about the data type of each value, review the metadata provided for the corresponding EntityType
.
You can paste the Power BI query listed below directly into the Get Data->Blank Query window. For more information, review Overview of sample reports using OData queries.
let
Source = OData.Feed ("https://analytics.dev.azure.com/{organization}/{project}/_odata/v3.0-preview/PipelineRuns?"
&"$apply=filter( "
&"CompletedDate ge {startdate} "
&")"
&"/groupby( "
&"(Pipeline/PipelineName), "
&"aggregate( "
&"$count as TotalCount, "
&"SucceededCount with sum as SucceededCount, "
&"FailedCount with sum as FailedCount, "
&"PartiallySucceededCount with sum as PartiallySucceededCount, "
&"CanceledCount with sum as CanceledCount "
&")) "
,null, [Implementation="2.0",OmitValues = ODataOmitValues.Nulls,ODataVersion = 4])
in
Source
Substitution strings and query breakdown
Substitute the following strings with your values. Don't include brackets {} with your substitution. For example if your organization name is "Fabrikam", replace {organization}
with Fabrikam
, not {Fabrikam}
.
{organization}
- Your organization name{project}
- Your team project name{startdate}
- The date to start your report. Format: YYYY-MM-DDZ. Example: 2022-09-01Z represents September 1, 2022. Don't enclose in quotes or brackets and use two digits for both, month and date.
Query breakdown
The following table describes each part of the query.
Query part
Description
$apply=filter(
Start filter()
clause.
CompletedDate ge {startdate}
Return pipeline runs for date greater than the specified date.
)
Close filter()
clause.
/groupby(
Start groupby()
clause/
(Pipeline/PipelineName),
Group data results by pipeline name.
aggregate(
Start aggregate
clause for each pipeline.
$count as TotalCount,
Count the total number of runs as TotalCount
.
SucceededCount with sum as SucceededCount
.
Count the number of successful runs as SucceededCount
.
FailedCount with sum as FailedCount,
Count the number of failed runs as FailedCount
.
PartiallySucceededCount with sum as PartiallySucceededCount,
Count the number of partially successful runs as PartiallySucceededCount
.
CanceledCount with sum as CanceledCount
Count the number of canceled runs as CanceledCount
.
))
Close aggregate()
and groupby()
clauses.
(Optional) Rename query
You can rename the default query label, Query1, to something more meaningful. Simply enter a new name from the Query Settings pane.
Expand Pipeline column in Power Query Editor
Prior to creating the report, expand the Pipeline
column that returns records that may contain one or more fields.
Close the Advanced Editor.
From the Power Query Editor, choose the
Pipeline
column expand button, ensure thatPipelineName
is selected, and then choose OK.The table now contains the expanded entity
Pipeline.PipelineName
.
Change column data type
From the Power Query Editor, select the TotalCount
column, and then select Data Type from the Transform menu, and choose Whole Number. For more information about changing the data type, see Transform Analytics data to generate Power BI reports, Transform a column data type.
(Optional) Rename column fields
You can rename column fields. For example, you can rename the column Pipeline.PipelineName
to Pipeline Name
, or TotalCount
to Total Count
. To learn how, see Rename column fields.
Close the query and apply your changes
Once you've completed all your data transformations, choose Close & Apply from the Home menu to save the query and return to the Report tab in Power BI.
Create the Stacked Column Chart report
In Power BI, under Visualizations, choose the Stacked Column Chart report.
Add
Pipeline.PipelineName
or the renamed columnPipeline Name
to Axis.Add the following fields to Values in the order indicated, and right-click each field and ensure Sum is selected.
SucceededCount
FailedCount
CanceledCount
PartiallySucceededCount
.
To add a slicer to the report, deselect the report and select Slicer from the Visualizations pane.
Add
Pipeline.PipelineName
or the renamed columnPipeline Name
to Field.
To change the slicer from a list to a dropdown menu option, select the Format your visual paint-brush icon from the Visualizations pane, and select the Dropdown option instead of List.
The report appears as follows.