Postil

Azure DevOps

Postil reviews Azure DevOps pull requests through the same engine it uses for GitHub and GitLab. Support is best effort: shipped, tested, and configured with the same token-plus-base-URL pattern as every other forge. The hosted app does not reach Azure DevOps; you run the CLI in your own pipeline with your own inference key.

1. Create a personal access token

Create a PAT scoped to Code (Read & Write) so it can read the PR diff and post thread comments. Store it as a secret pipeline variable named AZURE_DEVOPS_TOKEN. Add your inference key (MODEL_API_KEY) the same way.

2. Add the pipeline step

trigger: none
pr:
  branches:
    include: ['*']

pool:
  vmImage: ubuntu-latest

steps:
  - script: |
      curl -fsSL https://postil.dev/install.sh | sh
      export PATH="$HOME/.local/bin:$PATH"
      org="$(basename "${SYSTEM_COLLECTIONURI%/}")"
      postil review --forge azure \
        --repo "$org/$SYSTEM_TEAMPROJECT/$BUILD_REPOSITORY_NAME" \
        --pr "$SYSTEM_PULLREQUEST_PULLREQUESTID"
    env:
      AZURE_DEVOPS_TOKEN: $(AZURE_DEVOPS_TOKEN)
      MODEL_API_KEY: $(MODEL_API_KEY)
      POSTIL_API_KEY: $(MODEL_API_KEY)

The repository for --repo is organization/project/repository. A gate-failing review exits 1 and fails the step; a clean review exits 0 and posts nothing; see exit codes. Mark the pipeline required in the branch policy to make the gate binding.

3. Azure DevOps Server

For self-hosted Azure DevOps Server, point the CLI at your instance with AZURE_DEVOPS_API_URL:

export AZURE_DEVOPS_TOKEN=...
export MODEL_API_KEY=...
export POSTIL_API_KEY="$MODEL_API_KEY"
export AZURE_DEVOPS_API_URL=https://azuredevops.example.com
postil review --forge azure --repo organization/project/repository --pr 7

Local review against an Azure DevOps PR

export AZURE_DEVOPS_TOKEN=...
export MODEL_API_KEY=...
export POSTIL_API_KEY="$MODEL_API_KEY"
postil review --forge azure --repo organization/project/repository --pr 7

Parity and limits

  • Same gate thresholds, envelope schema, and exit codes as every other forge; see the CLI reference and exit codes.
  • postil respond (the @postil interactive bot) supports --pr only. Azure Boards work items use a different API base and version than the pull-request endpoints Postil talks to; pointing respond at --issue on Azure DevOps returns an error rather than silently doing nothing.
  • The hosted Postil app is GitHub-only today; on Azure DevOps you run the CLI in your own pipeline.
  • See the forges overview for GitHub, GitLab, and Bitbucket.