Navigation: Home > API Reference > Build API
The Azure DevOps Build API provides a comprehensive set of methods for interacting with build pipelines in Azure DevOps. It enables developers to programmatically manage build pipelines, queue builds, monitor build status, and access build artifacts and logs. This documentation provides detailed information about the most commonly used methods in the Build API.
The Build API is designed to facilitate:
The Build API is frequently used for:
Create and manage complex build and deployment pipelines that span multiple projects and repositories.
Build specialized dashboards that display build status, history, and performance metrics tailored to specific team needs.
Trigger builds automatically based on external events or system conditions beyond standard Azure DevOps triggers.
Coordinate builds across multiple projects to ensure consistent build processes and dependencies.
Track and analyze build performance metrics to identify bottlenecks and optimize build processes.
Create custom notification systems that alert teams about build status through various channels.
Connect Azure DevOps builds with external tools and services for enhanced functionality.
Automate the handling of build artifacts for deployment, archiving, or distribution.
This documentation covers:
To use the Build API, you'll need:
To start using the Build API, first establish a connection to your Azure DevOps organization:
import * as azdev from "azure-devops-node-api";
// Connection setup
const orgUrl = "https://dev.azure.com/yourorganization";
const token = "your-personal-access-token";
const authHandler = azdev.getPersonalAccessTokenHandler(token);
const connection = new azdev.WebApi(orgUrl, authHandler);
// Get Build API client
const buildApi = await connection.getBuildApi();
// Now you can use the Build API methods
// Example: Get all build pipelines
const buildDefinitions = await buildApi.getDefinitions("YourProject");
console.log(`Found ${buildDefinitions.length} build pipelines`);
The Build API is commonly used in conjunction with other Azure DevOps APIs to create comprehensive solutions:
Builds can be triggered by Git repository events and can operate on specific branches or commits.
Common integration patterns include:
See Git + Build Integration for detailed examples.
Builds can be linked to work items to track which requirements are implemented in which builds.
Common integration patterns include:
See Work Item + Build Integration for detailed examples.
For complex scenarios involving Build, Git, and Work Item Tracking APIs together, see Cross-API Examples.
For a comprehensive view of how Build API methods relate to other APIs, see the API Cross-Reference Table.