Azure DevOps Integration Setup Guide
This guide walks you through connecting Lathe Studio to Azure DevOps for CI/CD pipeline integration.
Prerequisites#
- Azure DevOps account (Azure DevOps Services or Azure DevOps Server)
- Azure DevOps project with build pipelines
- Project admin access in Lathe Studio
Overview#
The Azure DevOps integration enables:
- CI/CD Webhooks: Automatically create builds when Azure Pipelines complete
- Work Item Sync: Link test failures to Azure DevOps work items
- Pull Request Integration: Display test results in PRs
Connecting Azure DevOps#
Step 1: Create an API Key
- Go to Settings > Organization > API Keys
- Click Create API Key
- Give it a name (e.g., "Azure DevOps")
- Select scopes:
builds:read- View buildsbuilds:create- Create new builds
- Copy the generated key (shown only once)
Step 2: Configure Azure DevOps Service Hook
- In Azure DevOps, go to your project
- Navigate to Project Settings > Service Hooks
- Click Create subscription
- Select Web Hooks as the service
- Configure trigger:
- Event: Build completed
- Filter: Select your build pipeline
- Configure action:
- URL:
https://lathestudio.dev/api/webhooks/azure-devops - HTTP Headers:
Authorization:Bearer <your-api-key>Content-Type:application/json
- URL:
- Click Finish
Step 3: Test the Integration
- Run a build in Azure DevOps
- Go to Releases page in Lathe Studio
- You should see the build in the Build Queue section
- Assign it to a release
Authentication Methods#
Method 1: API Key (Recommended)
Include the API key in the Authorization header:
Authorization: Bearer pt_live_xxxxxxxxxxxxxxxx
Method 2: Organization ID
Include your organization ID in a custom header:
X-Pt-Org-Id: your-org-uuid
How It Works#
- Build Completes → Azure DevOps sends webhook to
/api/webhooks/azure-devops - Authentication → Webhook verifies API key or org ID
- Project Matching → System tries to match project URL to a Lathe Studio project
- Queue or Create:
- If project + active release found → Build created directly
- If project found but no release → Queued for release assignment
- If no project match → Queued for project + release assignment
- Assignment → User assigns queued builds via Releases page
Build Queue UI#
The Build Queue appears on the Releases page when there are pending builds:
- Shows build name, source (Azure DevOps), project, commit/branch
- Assign to Release: Select an active release for the project
- Select Project: Navigate to projects if project not auto-detected
- Reject: Remove build from queue (no build created)
Azure Pipelines Example#
Add this to your azure-pipelines.yml:
trigger:
branches:
include:
- main
- develop
stages:
- stage: Test
jobs:
- job: RunTests
pool:
vmImage: 'ubuntu-latest'
steps:
- script: npm test
displayName: 'Run tests'
- script: |
curl -X POST https://lathestudio.dev/api/v1/results/ingest \
-H "Authorization: Bearer $(PT_API_KEY)" \
-H "Content-Type: application/json" \
-d '{
"build_name": "Build $(Build.BuildNumber)",
"branch": "$(Build.SourceBranchName)",
"commit_sha": "$(Build.SourceVersion)",
"test_results": [...]
}'
displayName: 'Notify Lathe Studio'
env:
PT_API_KEY: $(PT_API_KEY)
Azure DevOps Server (On-Premises)#
For on-premises Azure DevOps Server:
- Ensure your server is accessible from the internet (or use reverse proxy)
- Use the same webhook URL:
https://lathestudio.dev/api/webhooks/azure-devops - Configure SSL certificates properly
- Allowlist Lathe Studio IP addresses if using a firewall:
- Contact support for current IP ranges
Work Item Integration#
To create work items for test failures:
- Connect Azure DevOps in Project Settings > Integrations
- Configure work item type (Bug, Task, etc.)
- Map Lathe Studio fields to Azure DevOps fields
- Enable automatic work item creation (optional)
Field Mappings
| Lathe Studio | Azure DevOps |
|---|---|
| Test Case Title | Title |
| Priority | Priority |
| Test Steps | Repro Steps |
| Tester Notes | Description |
| Environment | Environment |
Troubleshooting#
Builds not appearing
- Check service hook delivery in Azure DevOps (Project Settings > Service Hooks > History)
- Verify API key is not expired or revoked
- Ensure the build pipeline is correctly selected in the service hook
- Check that the project URL matches your Lathe Studio project settings
Wrong project assigned
The system matches by:
- Project URL (exact match)
- Project name (partial match)
- Repository URL
You can manually assign to the correct project from the queue.
Rate limiting
API keys are limited to 60 requests per minute by default. Contact support to increase limits.
Work items not creating
- Verify Azure DevOps connection is active
- Check work item type is valid for your project
- Ensure you have permission to create work items
- Review field mappings for required fields
Security#
- API keys are hashed using SHA-256 before storage
- Only the first 12 characters are stored for identification
- Keys can be revoked at any time
- Use Azure DevOps variable groups to securely store API keys
- All webhook communications use HTTPS
Unlinking Azure DevOps#
To disconnect:
- Go to Project Settings > Service Hooks in Azure DevOps
- Find the Lathe Studio subscription
- Click Delete
Note: Previously created builds remain in Lathe Studio. New builds will not be created until reconnected.
Advanced Configuration#
Branch Filtering
Configure which branches trigger builds in Project Settings > CI/CD:
- Include:
main,develop,release/* - Exclude:
dependabot/*,draft/*
Build Retention
Sync Azure DevOps build retention policies with Lathe Studio:
- Automatic cleanup of old builds
- Archive completed releases
For additional help, contact support.