SDKs overview
Azure DevOps offers a suite of Software Development Kits (SDKs) and client libraries designed to facilitate programmatic interaction with its services. These SDKs allow developers to automate various tasks, extend existing Azure DevOps functionalities, and build custom integrations. The available libraries cover core services such as Azure Boards for work item tracking, Azure Repos for source control, Azure Pipelines for CI/CD, Azure Test Plans for testing, and Azure Artifacts for package management. By using these SDKs, developers can create tools that manage projects, interact with Git repositories, orchestrate build and release processes, and more, directly from their applications.
The official SDKs are primarily maintained by Microsoft and are available across several popular programming languages, ensuring broad compatibility with different development environments. These libraries abstract the underlying REST APIs, providing a more developer-friendly interface for common operations. The focus is on enabling efficient development of integrations and automation scripts, rather than requiring direct interaction with HTTP requests and JSON parsing for every task. This approach helps streamline the development of applications that interact with the Azure DevOps platform, as described in the official Azure DevOps documentation.
Official SDKs by language
Microsoft provides official SDKs for Azure DevOps across multiple programming languages, each tailored to the language's conventions and ecosystem. These SDKs are maintained to ensure compatibility with the latest Azure DevOps API versions and offer a consistent way to interact with the platform's services. Developers can find detailed documentation for each language-specific SDK, including API references and usage examples, on the Microsoft Learn platform.
| Language | Package/Client Name | Installation Command | Maturity |
|---|---|---|---|
| .NET (C#) | Microsoft.TeamFoundationServer.Client and related NuGet packages |
dotnet add package Microsoft.TeamFoundationServer.Client |
Generally Available (GA) |
| Java | azure-devops-client |
Add to pom.xml: <dependency><groupId>com.microsoft.azure.devops</groupId><artifactId>azure-devops-client</artifactId><version>{version}</version></dependency> |
Generally Available (GA) |
| Python | azure-devops |
pip install azure-devops |
Generally Available (GA) |
| TypeScript/JavaScript | azure-devops-node-api |
npm install azure-devops-node-api or yarn add azure-devops-node-api |
Generally Available (GA) |
The .NET SDK, for instance, is a comprehensive set of NuGet packages that allow C# developers to build robust applications interacting with Azure DevOps. These packages provide strongly typed clients for various services, making it easier to manage work items, build definitions, release pipelines, and more. For Python developers, the azure-devops library offers a similar level of access, integrating seamlessly into Python-based automation scripts and data analysis workflows. The TypeScript/JavaScript SDK, azure-devops-node-api, is particularly useful for building Node.js applications and command-line tools that interact with Azure DevOps, aligning with modern web development practices.
Each SDK is designed to handle authentication and API calls, abstracting away the complexities of the underlying REST API. Developers can authenticate using Personal Access Tokens (PATs), OAuth, or Azure Active Directory, depending on the application context and security requirements. For detailed authentication guidance, refer to the official Microsoft documentation on Azure DevOps authentication methods.
Installation
Installing the Azure DevOps SDKs typically involves using the package manager specific to the chosen programming language. The process is straightforward and aligns with standard practices for dependency management in each ecosystem.
.NET (C#)
For .NET projects, the Azure DevOps client libraries are distributed as NuGet packages. You can install them using the .NET CLI or the NuGet Package Manager in Visual Studio.
dotnet add package Microsoft.TeamFoundationServer.Client
dotnet add package Microsoft.VisualStudio.Services.Client
# Add other specific service clients as needed, e.g., Microsoft.TeamFoundation.DistributedTask.WebApi
This command adds the necessary client packages to your project file, allowing you to reference the Azure DevOps APIs in your C# code.
Java
Java developers can include the Azure DevOps client library by adding a dependency to their Maven pom.xml file or Gradle build file. The library is available on Maven Central.
<dependency>
<groupId>com.microsoft.azure.devops</groupId>
<artifactId>azure-devops-client</artifactId>
<version>{latest_version}</version> <!-- Replace with the actual latest version -->
</dependency>
After adding the dependency, your build tool will download and make the library available for use in your Java application.
Python
The Python SDK for Azure DevOps is installed using pip, the standard Python package installer.
pip install azure-devops
This command installs the core azure-devops package, which includes clients for most Azure DevOps services.
TypeScript/JavaScript
For Node.js or browser-based applications, the TypeScript/JavaScript SDK is available via npm or yarn.
npm install azure-devops-node-api
# or
yarn add azure-devops-node-api
This installs the library and its dependencies, allowing you to import and use the client modules in your JavaScript or TypeScript code.
Quickstart example
This Python example demonstrates how to connect to Azure DevOps, list projects, and retrieve information about a specific team project using the azure-devops SDK. Before running, ensure you have installed the Python SDK (pip install azure-devops) and set up a Personal Access Token (PAT) with appropriate permissions in Azure DevOps. For guidance on creating a PAT, review the Azure DevOps PAT creation guide.
import os
from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication
# --- Configuration ---
# Your Azure DevOps organization URL
organization_url = "https://dev.azure.com/your-organization"
# Your Personal Access Token (PAT)
personal_access_token = os.environ.get("AZURE_DEVOPS_PAT") # Recommended: use environment variable
# --- Authentication ---
credentials = BasicAuthentication("", personal_access_token)
# Create a connection to the Azure DevOps organization
connection = Connection(base_url=organization_url, creds=credentials)
# Get a client for the Core API (used for projects, teams, etc.)
core_client = connection.clients.get_core_client()
def list_azure_devops_projects():
print("Listing Azure DevOps Projects:")
try:
# Get all projects in the organization
projects = core_client.get_projects()
if projects:
for project in projects:
print(f" - Project Name: {project.name} (ID: {project.id})")
else:
print(" No projects found.")
except Exception as e:
print(f"Error listing projects: {e}")
def get_project_details(project_name_or_id):
print(f"\nGetting details for project: {project_name_or_id}")
try:
project = core_client.get_project(project_name_or_id)
print(f" Name: {project.name}")
print(f" ID: {project.id}")
print(f" Description: {project.description}")
print(f" State: {project.state}")
print(f" Revision: {project.revision}")
except Exception as e:
print(f"Error getting project details: {e}")
if __name__ == "__main__":
list_azure_devops_projects()
# Replace 'MyAwesomeProject' with an actual project name or ID from your organization
# get_project_details("MyAwesomeProject")
This example initializes a connection using a Personal Access Token and then utilizes the core_client to fetch and display project information. This structure can be adapted to interact with other Azure DevOps services by instantiating the relevant client (e.g., build_client = connection.clients.get_build_client() for build pipelines).
Community libraries
Beyond the official SDKs, the Azure DevOps ecosystem benefits from an active community that contributes various tools, libraries, and extensions. These community-driven projects often address specific use cases, provide alternative language bindings, or offer utilities that complement the official offerings. While not officially supported by Microsoft, many of these libraries are well-maintained and widely used.
- PowerShell Modules: Several community-developed PowerShell modules exist to interact with Azure DevOps, enabling administrators and developers to automate tasks and manage configurations using scripting. These modules often wrap the REST APIs or leverage the .NET client libraries to provide a more PowerShell-idiomatic experience. For example, the Azure DevOps PowerShell module is a popular choice for scripting interactions.
- Go Clients: While there isn't an official Go SDK from Microsoft, various community projects offer Go language bindings for the Azure DevOps REST API. These clients allow Go developers to integrate Azure DevOps into their applications and build automation tools.
- CLI Tools: In addition to the official Azure CLI with its Azure DevOps extension, the community has developed specialized command-line interfaces for specific tasks or alternative workflows. These tools often aim to simplify complex operations or provide a more streamlined user experience for particular use cases.
- Extensions for IDEs and Editors: The Azure DevOps marketplace features a multitude of community-contributed extensions for popular IDEs (like Visual Studio Code) and other development tools, enhancing the developer experience by integrating Azure DevOps functionalities directly into their preferred environments. These extensions often rely on the underlying REST APIs and sometimes use the official SDKs internally.
When considering community libraries, it is advisable to check their active maintenance status, community support, and licensing. Resources such as GitHub and the Azure DevOps Marketplace are good starting points for discovering these tools, as noted in general guidance on selecting third-party libraries for development projects by developer.mozilla.org.