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 |
|---|---|---|---|
| Required | String | An Azure Service Principal clientId (UUID format). Pass as a secret. See how to register an Azure app. |
| Required | String | An Azure Service Principal clientSecret. Pass as a secret. See how to register an Azure app. |
| Required | String | The Azure tenant identifier (UUID format). You can pass as a secret. |
| Required | String | The name of the Azure DevOps organization. Example: |
| Required | String | The URL path for the Azure DevOps REST API request (max length 1000). Example: |
| Required | String | One of [ |
| Optional | Map | An optional body as a JSON map. Pass it with |
| Optional | List | A list of JQ expressions to extract values from the response. Each selector maps a name to a JQ expression. Example: |
This action returns the following outputs:
Output Field | Type | Description |
|---|---|---|
| Boolean |
|
| String | Contains the failure reason if the action fails. |
| Object |
Each API endpoint returns a different response. See Azure DevOps REST API reference. |
| String | The URL to poll for async operations. Read |
| 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: GETExample: 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.nameExample: 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