# Azure DevOps

<div class="view-markdown-wrapper">
<ViewMarkdown />
</div>

Run your Shiplight E2E tests in Azure Pipelines and upload the results to [Shiplight Cloud](https://app.shiplight.ai). Azure DevOps uses the same `shiplight` CLI as every other provider — only the pipeline syntax differs.

## Before you start

- A scaffolded Shiplight test project (`/shiplight init`). See the [CI/CD overview](/local/ci) for how the pieces fit together.
- An org API token from [app.shiplight.ai/api-tokens](https://app.shiplight.ai/api-tokens), stored as a **secret pipeline variable** named `SHIPLIGHT_API_TOKEN` (**Pipelines → Edit → Variables**, "Keep this value secret"). Secret variables are not injected into the environment automatically — the template maps it explicitly via `env:`.

## Pipeline

Create `azure-pipelines.yml` at your repository root:

```yaml
trigger:
  - main

pool:
  vmImage: ubuntu-latest

variables:
  CI: "true"

steps:
  - task: NodeTool@0
    inputs:
      versionSpec: "22.x"
    displayName: Use Node 22

  - script: |
      curl -fsSL https://bun.sh/install | bash
      echo "##vso[task.prependpath]$HOME/.bun/bin"
    displayName: Install Bun

  - script: bun install
    displayName: Install dependencies

  - script: bun run playwright install --with-deps chromium
    displayName: Install Chromium

  - script: bun run shiplight test
    displayName: Run E2E tests
    env:
      SHIPLIGHT_API_TOKEN: $(SHIPLIGHT_API_TOKEN) # map the secret variable into env

```

## Notes

- `SHIPLIGHT_API_TOKEN` enables completed test report uploads; set it as a CI secret.
- `CI=true` plus `SHIPLIGHT_API_TOKEN` enables the shared Shiplight Cloud action cache. AI-powered actions can self-heal through the Shiplight LLM proxy, and healed locators from passing tests are reused by later runs.
- Secret variables must be mapped into `env:` per step (`SHIPLIGHT_API_TOKEN: $(SHIPLIGHT_API_TOKEN)`).
- Install Chromium yourself (`bun run playwright install --with-deps chromium`); the hosted image doesn't ship it.
- **Failure triage on Azure DevOps:** classification runs on the server for uploaded runs from any provider, but the optional autofix workflow ([auto-triage](/local/ci#auto-triage-failures)) is GitHub Actions only.
- Project in a subdirectory (e.g. `tests/e2e`)? Add `workingDirectory: tests/e2e` to each `script` step.

## Related

- [CI/CD overview](/local/ci) · [Custom setups](/local/ci/custom) · [CLI Reference](/local/cli-reference)
