• /
  • EnglishEspañolFrançais日本語한국어Português
  • Inicia sesiónComenzar ahora

Execute an Azure DevOps API

The Azure DevOps API action enables you to call any Azure DevOps REST API directly from your workflows, without needing a dedicated action for each operation.

Execute an Azure DevOps API

This action allows you to execute any operation documented in the Azure DevOps REST API reference. Provide the organization, API path, HTTP method, and optional request body — the action handles authentication automatically.

The following inputs are available for this action:

Input Field

Optionality

Type

Description

clientId

Required

String

An Azure Service Principal clientId (UUID format). Pass as a secret. See how to register an Azure app.

clientSecret

Required

String

An Azure Service Principal clientSecret. Pass as a secret. See how to register an Azure app.

tenantId

Required

String

The Azure tenant identifier (UUID format). You can pass as a secret.

organization

Required

String

The name of the Azure DevOps organization. Example: "myOrganization"

urlPath

Required

String

The URL path for the Azure DevOps REST API request (max length 1000). Example: "/{project}/_apis/pipelines/{pipelineId}/runs?api-version=7.0"

method

Required

String

One of ["GET", "POST", "PUT", "PATCH", "DELETE"]

body

Optional

Map

An optional body as a JSON map. Pass it with PUT, PATCH, and POST methods when the request requires a body. Supports secret references.

selectors

Optional

List

A list of JQ expressions to extract values from the response. Each selector maps a name to a JQ expression. Example: [{"name": "pipelineId", "expression": ".response.id"}]

This action returns the following outputs:

Output Field

Type

Description

success

Boolean

success: true | false

errorMessage

String

Contains the failure reason if the action fails.

response

Object

<azure devops api body response>

Each API endpoint returns a different response. See Azure DevOps REST API reference.

asyncResponseUrl

String

The URL to poll for async operations. Read status or state from response to track completion.

retryAfterSeconds

Integer

Wait time in seconds the server recommends before retrying or polling the async URL.

Example: Get projects

- name: getProjects
type: action
action: azure.devops.api
version: 1
inputs:
clientId: ${{ :secrets:azure-client-id }}
clientSecret: ${{ :secrets:azure-client-secret }}
tenantId: ${{ :secrets:azure-client-tenant }}
organization: ${{ :secrets:organization }}
urlPath: _apis/projects
method: GET

Example: Create a pipeline

- name: createPipeline
type: action
action: azure.devops.api
version: 1
inputs:
clientId: ${{ :secrets:azure-client-id }}
clientSecret: ${{ :secrets:azure-client-secret }}
tenantId: ${{ :secrets:azure-client-tenant }}
organization: ${{ :secrets:organization }}
urlPath: myProject/_apis/pipelines?api-version=7.1
method: POST
body:
name: testPipeline
folder: \
configuration:
type: yaml
path: pipelineConfig.yml
repository:
id: 1a8bcfa4-1412-4b3b-af36-4ff1aa5860a1
name: testRepository
type: azureReposGit
selectors:
- name: pipelineId
expression: .response.id
- name: pipelineName
expression: .response.name

Example: Run a pipeline

- name: runPipeline
type: action
action: azure.devops.api
version: 1
inputs:
clientId: ${{ :secrets:azure-client-id }}
clientSecret: ${{ :secrets:azure-client-secret }}
tenantId: ${{ :secrets:azure-client-tenant }}
organization: ${{ :secrets:organization }}
urlPath: myProject/_apis/pipelines/1/runs?api-version=7.1-preview.1
method: POST
body:
resources: {}
variables: {}

Example: Delete a pipeline

- name: deletePipeline
type: action
action: azure.devops.api
version: 1
inputs:
clientId: ${{ :secrets:azure-client-id }}
clientSecret: ${{ :secrets:azure-client-secret }}
tenantId: ${{ :secrets:azure-client-tenant }}
organization: ${{ :secrets:organization }}
urlPath: myProject/_apis/build/definitions/1?api-version=7.1-preview.7
method: DELETE
Copyright © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.