Azure DevOps query editor
This document explains how to use the Azure DevOps query editor to retrieve and visualize data from Azure DevOps.
Before you begin
- Configure the Azure DevOps data source.
- Verify your personal access token has the required PAT scopes.
Key concepts
If you’re new to Azure DevOps, the following terms are used throughout this documentation:
Query types
The query editor supports the following query types. Select a query type from the Query Type drop-down to configure the query.
- Projects: List all projects in your organization.
- Repositories: List Git repositories.
- Pull Requests: List pull requests for a project.
- Builds: List builds for a project, scoped to the dashboard time range.
- Build Definitions: List build pipeline definitions for a project.
- Pipelines: List YAML pipelines for a project.
- Pipeline Runs: List runs for a specific pipeline.
- Releases: List releases for a project, scoped to the dashboard time range.
- Release Definitions: List release pipeline definitions for a project.
- Release Deployments: List deployments for a project, scoped to the dashboard time range.
Common fields
Most query types require a Project selection. The Project drop-down lists all projects accessible to your PAT. You can also select dashboard template variables from the drop-down.
Create a query
Each query type has its own set of fields. The following sections describe the available fields for each query type.
Projects
The Projects query type returns a list of all projects in the organization accessible to the configured PAT. No additional fields are required.
Repositories
The Repositories query type returns a list of Git repositories.
Pull requests
The Pull Requests query type returns pull requests for a specified project.
Builds
The Builds query type returns builds for a specified project. Results are automatically scoped to the dashboard time range using the minTime and maxTime API parameters.
Build definitions
The Build Definitions query type returns build pipeline definitions for a specified project.
Pipelines
The Pipelines query type returns YAML pipelines for a specified project. No additional filter fields are available.
Pipeline runs
The Pipeline Runs query type returns runs for a specific pipeline.
Releases
The Releases query type returns releases for a specified project. Results are automatically scoped to the dashboard time range using the minCreatedTime and maxCreatedTime API parameters.
Release definitions
The Release Definitions query type returns release pipeline definitions for a specified project. No additional filter fields are available.
Release deployments
The Release Deployments query type returns deployments for a specified project. Results are automatically scoped to the dashboard time range using the minStartedTime and maxStartedTime API parameters.
Use cases
The following examples show how to configure the query editor for common monitoring scenarios.
Track CI build health
To monitor build success and failure rates for a project over time:
- Select Builds as the query type.
- Select your project from the Project drop-down.
- Set Result to
failedto focus on failures (or leave empty to see all results). - Set Query Order to
finishTimeDescendingto see the most recent builds first.
The dashboard time range automatically scopes the results, so you can adjust it to view builds from the last hour, day, or week.
To compare build health across multiple definitions, add a second query with a different Definitions filter.
Monitor open pull requests
To track active pull requests awaiting review:
- Select Pull Requests as the query type.
- Select your project from the Project drop-down.
- Set Status to
Active. - Optionally set Repository to focus on a specific repository.
To find pull requests assigned to a specific reviewer, enter their identity in the Reviewer ID field.
Track deployment frequency and status
To monitor how often deployments happen and whether they succeed:
- Select Release Deployments as the query type.
- Select your project from the Project drop-down.
- Set Last attempt only to on to avoid counting retries.
- Set Query order to
descendingto see the most recent deployments first.
To filter to a specific release pipeline, enter its ID in the Definition Id field. To focus on failures, set Operation status to phaseFailed.
Monitor pipeline run duration
To track how long pipeline runs take over time:
- Select Pipeline Runs as the query type.
- Select your project from the Project drop-down.
- Select the pipeline from the Pipeline drop-down.
Use Transformations to calculate durations from the returned start and finish timestamps.
View repository inventory
To get an overview of all repositories in a project:
- Select Repositories as the query type.
- Select your project from the Project drop-down.
Leave the Project field empty to list repositories across the entire organization. This is useful for org-level dashboards that track repository count and activity.
Audit build definitions
To find build pipeline configurations matching specific criteria:
- Select Build Definitions as the query type.
- Select your project from the Project drop-down.
- Optionally set Name to filter definitions by name pattern.
- Optionally set Path to focus on definitions under a specific folder (for example,
\production).
To find YAML-based pipelines, enter the pipeline filename in the Yaml File Name field. To sort by most recently updated, set queryOrder to lastModifiedDescending.
Audit releases by branch
To review releases from a specific source branch:
- Select Releases as the query type.
- Select your project from the Project drop-down.
- Enter the branch name in the sourceBranchFilter field (for example,
refs/heads/main). - Set Top to limit the number of results.
To narrow results further, set Status to active or use tagFilter to find releases with specific tags.
Use template variables in queries
The Project and Repository drop-downs in the query editor include dashboard template variables as selectable options. This lets you create dynamic dashboards where the project or repository is controlled by a variable selector. For more information, refer to Template variables.
Next steps
- Use annotations to overlay Azure DevOps events on dashboard panels.
- Use template variables to create dynamic, reusable dashboards.


