> ## Documentation Index
> Fetch the complete documentation index at: https://docs.guild.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure DevOps

> Give agents authenticated access to the Azure DevOps REST API.

The `@guildai-services/guildai~azure-devops` package provides agents with access to the Azure DevOps REST API through Guild's OAuth 2.0 integration.

This integration is generally available for all production users.

## Authentication

* **Type:** OAuth 2.0 (Microsoft identity platform)
* **Token expiration:** 1 hour (auto-refreshed)

### Setup

<Steps>
  <Step title="Open Credentials">Go to **Credentials** in Guild.</Step>
  <Step title="Connect Azure DevOps">Click **Azure DevOps** and authorize through your Microsoft account.</Step>
  <Step title="Grant access">Authorize access to your Azure DevOps organization.</Step>
</Steps>

## Usage

```typescript theme={null}
import { azureDevOpsTools } from "@guildai-services/guildai~azure-devops"
import { llmAgent } from "@guildai/agents-sdk"

export default llmAgent({
  description: "An agent that manages Azure DevOps work items",
  tools: { ...azureDevOpsTools },
})
```

### Selecting specific tools

Agents perform better with fewer tools. Use `pick()` to include only what your agent needs. Tools are named with the `azure_devops_` prefix — for example, `work_items_list` becomes `azure_devops_work_items_list`.

```typescript theme={null}
import { azureDevOpsTools } from "@guildai-services/guildai~azure-devops"
import { llmAgent, pick } from "@guildai/agents-sdk"

export default llmAgent({
  description: "An agent that manages Azure DevOps work items",
  tools: {
    ...pick(azureDevOpsTools, [
      "azure_devops_work_items_list",
      "azure_devops_work_items_get_work_item",
      "azure_devops_work_items_create",
      "azure_devops_work_items_update",
    ]),
  },
})
```

## API endpoints

All paths are prefixed with `/{organization}/{project}` unless noted.

<AccordionGroup>
  <Accordion title="Repositories">
    | Operation                     | Method | Path                                     |
    | ----------------------------- | ------ | ---------------------------------------- |
    | `repositories_list`           | GET    | `/_apis/git/repositories`                |
    | `repositories_create`         | POST   | `/_apis/git/repositories`                |
    | `repositories_get_repository` | GET    | `/_apis/git/repositories/{repositoryId}` |
    | `repositories_update`         | PATCH  | `/_apis/git/repositories/{repositoryId}` |
    | `repositories_delete`         | DELETE | `/_apis/git/repositories/{repositoryId}` |
  </Accordion>

  <Accordion title="Commits">
    | Operation                   | Method | Path                                                                |
    | --------------------------- | ------ | ------------------------------------------------------------------- |
    | `commits_get_push_commits`  | GET    | `/_apis/git/repositories/{repositoryId}/commits`                    |
    | `commits_get`               | GET    | `/_apis/git/repositories/{repositoryId}/commits/{commitId}`         |
    | `commits_get_changes`       | GET    | `/_apis/git/repositories/{repositoryId}/commits/{commitId}/changes` |
    | `commits_get_commits_batch` | POST   | `/_apis/git/repositories/{repositoryId}/commitsbatch`               |
  </Accordion>

  <Accordion title="Pull requests">
    | Operation                                    | Method | Path                                                                  |
    | -------------------------------------------- | ------ | --------------------------------------------------------------------- |
    | `pull_requests_get_pull_requests_by_project` | GET    | `/_apis/git/pullrequests`                                             |
    | `pull_requests_get_pull_requests`            | GET    | `/_apis/git/repositories/{repositoryId}/pullrequests`                 |
    | `pull_requests_create`                       | POST   | `/_apis/git/repositories/{repositoryId}/pullrequests`                 |
    | `pull_requests_get_pull_request`             | GET    | `/_apis/git/repositories/{repositoryId}/pullrequests/{pullRequestId}` |
    | `pull_requests_update`                       | PATCH  | `/_apis/git/repositories/{repositoryId}/pullrequests/{pullRequestId}` |
  </Accordion>

  <Accordion title="Pipelines & builds">
    | Operation               | Method | Path                                         |
    | ----------------------- | ------ | -------------------------------------------- |
    | `pipelines_list`        | GET    | `/_apis/pipelines`                           |
    | `pipelines_create`      | POST   | `/_apis/pipelines`                           |
    | `pipelines_get`         | GET    | `/_apis/pipelines/{pipelineId}`              |
    | `runs_list`             | GET    | `/_apis/pipelines/{pipelineId}/runs`         |
    | `runs_run_pipeline`     | POST   | `/_apis/pipelines/{pipelineId}/runs`         |
    | `runs_get`              | GET    | `/_apis/pipelines/{pipelineId}/runs/{runId}` |
    | `builds_list`           | GET    | `/_apis/build/builds`                        |
    | `builds_queue`          | POST   | `/_apis/build/builds`                        |
    | `builds_get`            | GET    | `/_apis/build/builds/{buildId}`              |
    | `builds_get_build_logs` | GET    | `/_apis/build/builds/{buildId}/logs`         |
    | `definitions_list`      | GET    | `/_apis/build/definitions`                   |
    | `definitions_create`    | POST   | `/_apis/build/definitions`                   |
    | `definitions_get`       | GET    | `/_apis/build/definitions/{definitionId}`    |
  </Accordion>

  <Accordion title="Work items">
    | Operation                           | Method | Path                          |
    | ----------------------------------- | ------ | ----------------------------- |
    | `work_items_list`                   | GET    | `/_apis/wit/workitems`        |
    | `work_items_get_work_item_template` | GET    | `/_apis/wit/workitems/{type}` |
    | `work_items_create`                 | POST   | `/_apis/wit/workitems/{type}` |
    | `work_items_get_work_item`          | GET    | `/_apis/wit/workitems/{id}`   |
    | `work_items_update`                 | PATCH  | `/_apis/wit/workitems/{id}`   |
    | `work_items_delete`                 | DELETE | `/_apis/wit/workitems/{id}`   |
    | `work_items_get_work_items_batch`   | POST   | `/_apis/wit/workitemsbatch`   |
    | `queries_list`                      | GET    | `/_apis/wit/queries`          |
    | `queries_get`                       | GET    | `/_apis/wit/queries/{query}`  |
    | `queries_create`                    | POST   | `/_apis/wit/queries/{query}`  |
    | `work_item_types_list`              | GET    | `/_apis/wit/workitemtypes`    |
    | `fields_list`                       | GET    | `/_apis/wit/fields`           |
  </Accordion>

  <Accordion title="Approvals & checks">
    | Operation                     | Method | Path                                          |
    | ----------------------------- | ------ | --------------------------------------------- |
    | `approvals_query`             | GET    | `/_apis/pipelines/approvals`                  |
    | `approvals_update`            | PATCH  | `/_apis/pipelines/approvals`                  |
    | `approvals_get`               | GET    | `/_apis/pipelines/approvals/{approvalId}`     |
    | `check_configurations_list`   | GET    | `/_apis/pipelines/checks/configurations`      |
    | `check_configurations_add`    | POST   | `/_apis/pipelines/checks/configurations`      |
    | `check_configurations_get`    | GET    | `/_apis/pipelines/checks/configurations/{id}` |
    | `check_configurations_update` | PATCH  | `/_apis/pipelines/checks/configurations/{id}` |
    | `check_configurations_delete` | DELETE | `/_apis/pipelines/checks/configurations/{id}` |
  </Accordion>

  <Accordion title="Agent pools & deployment groups">
    | Operation                      | Method | Path                                                             |
    | ------------------------------ | ------ | ---------------------------------------------------------------- |
    | `pools_get_agent_pools_by_ids` | GET    | `/{organization}/_apis/distributedtask/pools`                    |
    | `pools_add`                    | POST   | `/{organization}/_apis/distributedtask/pools`                    |
    | `pools_get`                    | GET    | `/{organization}/_apis/distributedtask/pools/{poolId}`           |
    | `agents_list`                  | GET    | `/{organization}/_apis/distributedtask/pools/{poolId}/agents`    |
    | `deploymentgroups_list`        | GET    | `/_apis/distributedtask/deploymentgroups`                        |
    | `deploymentgroups_add`         | POST   | `/_apis/distributedtask/deploymentgroups`                        |
    | `deploymentgroups_get`         | GET    | `/_apis/distributedtask/deploymentgroups/{deploymentGroupId}`    |
    | `variablegroups_get`           | GET    | `/{organization}/_apis/distributedtask/variablegroups/{groupId}` |
    | `variablegroups_add`           | POST   | `/{organization}/_apis/distributedtask/variablegroups`           |
  </Accordion>
</AccordionGroup>

## Webhook events

Azure DevOps does not support webhook triggers in Guild. This integration is API-access only.

## Limitations

* No webhook or trigger support
* API access requires the user's Azure DevOps organization to be accessible via the authorized Microsoft account
