Grafana Cloud Enterprise
Last reviewed: March 25, 2026

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

Key concepts

If you’re new to Azure DevOps, the following terms are used throughout this documentation:

TermDescription
ProjectA container for source code, builds, releases, and other resources within an Azure DevOps organization.
RepositoryA Git repository within a project.
Pull requestA code review request to merge changes from one branch into another.
BuildA single execution of a build pipeline, producing artifacts from source code.
Build definitionThe configuration template that defines how a build pipeline runs.
PipelineA YAML-based CI/CD pipeline definition.
Pipeline runA single execution of a YAML pipeline.
ReleaseA deployment of artifacts to one or more environments using the classic release pipeline.
Release definitionThe configuration template for a classic release pipeline.
Release deploymentA single deployment operation within a release to a specific environment.

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.

FieldRequiredDescription
ProjectNoFilter repositories to a specific project. If empty, returns repositories across the organization.

Pull requests

The Pull Requests query type returns pull requests for a specified project.

FieldRequiredDescription
ProjectYesThe project to retrieve pull requests from.
RepositoryNoFilter pull requests to a specific repository.
Creator IdNoFilter to pull requests created by this identity.
Reviewer IDNoFilter to pull requests where this identity is a reviewer.
StatusNoFilter by status: All, Active, Completed, Not Set, or Abandoned. Defaults to All if unset.
Repository IDNoFilter to pull requests whose source branch is in this source repository.
Source RefNoFilter to pull requests from this source branch.
Target RefNoFilter to pull requests targeting this branch.

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.

FieldRequiredDescription
ProjectYesThe project to retrieve builds from.
ReasonNoFilter by build reason: all, batchedCI, buildCompletion, checkInShelveset, individualCI, manual, none, pullRequest, resourceTrigger, schedule, scheduleForced, triggered, userCreated, or validateShelveset.
ResultNoFilter by build result: canceled, failed, none, partiallySucceeded, or succeeded.
StatusNoFilter by build status: all, cancelling, completed, inProgress, none, notStarted, or postponed.
Repo IDNoFilter to builds from this repository.
Repo TypeNoFilter to builds from repositories of this type.
BranchNoFilter to builds from this branch.
Build numberNoFilter to builds matching this build number. Append * for prefix matching.
Build IDsNoComma-separated list of build IDs to retrieve.
DefinitionsNoComma-separated list of definition IDs to filter by.
Query OrderNoSort order: finishTimeAscending, finishTimeDescending, queueTimeAscending, queueTimeDescending, startTimeAscending, or startTimeDescending.
TagsNoComma-separated list of tags. Returns only builds that have these tags.
Requested ForNoFilter to builds requested by this user.

Build definitions

The Build Definitions query type returns build pipeline definitions for a specified project.

FieldRequiredDescription
ProjectYesThe project to retrieve build definitions from.
NameNoFilter to definitions whose names match this pattern.
PathNoFilter to definitions under this folder path.
Yaml File NameNoFilter to YAML definitions matching this filename.
repositoryIdNoFilter to definitions that use this repository.
repositoryTypeNoFilter to definitions with this repository type.
taskIdFilterNoFilter to definitions that use this task.
queryOrderNoSort order: definitionNameAscending, definitionNameDescending, lastModifiedAscending, lastModifiedDescending, or none.
processTypeNoFilter to definitions with this process type.
definitionIdsNoComma-separated list of definition IDs to retrieve.

Pipelines

The Pipelines query type returns YAML pipelines for a specified project. No additional filter fields are available.

FieldRequiredDescription
ProjectYesThe project to retrieve pipelines from.

Pipeline runs

The Pipeline Runs query type returns runs for a specific pipeline.

FieldRequiredDescription
ProjectYesThe project containing the pipeline.
PipelineYesThe pipeline to retrieve runs from.

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.

FieldRequiredDescription
ProjectYesThe project to retrieve releases from.
Search TextNoFilter to releases with names containing this text.
StatusNoFilter by status: abandoned, active, draft, or undefined.
Created ByNoFilter to releases created by this user.
Query OrderNoSort order by created date: ascending or descending. Default: descending.
definitionIdNoFilter to releases from this release definition ID.
definitionEnvironmentIdNoFilter to releases with this definition environment ID.
environmentStatusFilterNoFilter by environment status.
TopNoMaximum number of releases to return. Default: 50.
sourceIdNoFilter by artifact source identifier (for example, {projectGuid}:{BuildDefinitionId} for build artifacts).
artifactTypeIdNoFilter by artifact type: Build, Jenkins, GitHub, Nuget, Git, TFVC, and others.
artifactVersionIdNoFilter by artifact version (for example, the build ID for build artifacts).
sourceBranchFilterNoFilter to releases from this source branch.
pathNoFilter to releases under this folder path.
tagFilterNoComma-separated list of tags. Returns only releases with these tags.
releaseIdFilterNoComma-separated list of release IDs to retrieve.

Release definitions

The Release Definitions query type returns release pipeline definitions for a specified project. No additional filter fields are available.

FieldRequiredDescription
ProjectYesThe project to retrieve release definitions from.

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.

FieldRequiredDescription
ProjectYesThe project to retrieve deployments from.
Created ByNoFilter to deployments created by this user.
Created ForNoFilter to deployments created for this user.
Last attempt onlyNoWhen enabled, return only the latest deployment attempt for each environment.
Source branchNoFilter to deployments from this source branch.
Definition IdNoFilter to deployments from this release definition.
Definition Environment IdNoFilter to deployments for this environment within the release definition.
Deployment statusNoFilter by deployment status.
Operation statusNoFilter by operation status: all, approved, canceled, cancelling, deferred, evaluatingGates, gateFailed, manualInterventionPending, pending, phaseCanceled, phaseFailed, phaseInProgress, phasePartiallySucceeded, phaseSucceeded, queued, queuedForAgent, queuedForPipeline, rejected, scheduled, or undefined.
Query orderNoSort order: ascending or descending.
TopNoMaximum number of deployments to return.

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:

  1. Select Builds as the query type.
  2. Select your project from the Project drop-down.
  3. Set Result to failed to focus on failures (or leave empty to see all results).
  4. Set Query Order to finishTimeDescending to 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:

  1. Select Pull Requests as the query type.
  2. Select your project from the Project drop-down.
  3. Set Status to Active.
  4. 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:

  1. Select Release Deployments as the query type.
  2. Select your project from the Project drop-down.
  3. Set Last attempt only to on to avoid counting retries.
  4. Set Query order to descending to 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:

  1. Select Pipeline Runs as the query type.
  2. Select your project from the Project drop-down.
  3. 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:

  1. Select Repositories as the query type.
  2. 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:

  1. Select Build Definitions as the query type.
  2. Select your project from the Project drop-down.
  3. Optionally set Name to filter definitions by name pattern.
  4. 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:

  1. Select Releases as the query type.
  2. Select your project from the Project drop-down.
  3. Enter the branch name in the sourceBranchFilter field (for example, refs/heads/main).
  4. 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