azure-pipelines-tasks
Copilot instructions3.7k starsChanged 9 months agoMITView on GitHub
This repository contains the in-the-box tasks for Azure Pipelines and Team Foundation Server. These instructions will help you understand how to build, test, and deploy tasks effectively. This repo provides open examples of how Azure Pipelines tasks are written and can help you write custom tasks for upload to your account or server. Tasks are tool runners that know how to execute tools like MSBuild, VSTest, etc., handle return codes, process stdout/stderr, write timeline records, and access credentials for Azure…
- Reads credentials
- Installs packages
Trending
Quiet this year.thin dataabout the whole repository
Who's talking about microsoft/azure-pipelines-tasks
- Azure/azure-cli“Azure CLI task fails: AADSTS700024: Client assertion is not within its valid time range”GitHub · Apr 8, 2024 · 65 reactions
- Azure/azure-cosmos-db-emulator-docker“Azure Cosmos Emulator docker image is broken”GitHub · Jan 25, 2024 · 25 reactions
- actions/setup-dotnet“Support installing the latest patch or minor version”GitHub · Aug 21, 2019 · 19 reactions
- Azure/functions-action“Error 404: When request Azure resource at PublishContent, zipDeploy : Failed to use …”GitHub · Jan 31, 2024 · 18 reactions
- MicrosoftDocs/vsts-rest-api-specs“Docs for the `.../distributedtask/securefiles` endpoint are missing from the `distributedtask` section”GitHub · Sep 23, 2023 · 18 reactions
The biggest 5 of 8 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 8
Talked about on GitHub and Hacker News (8 times).
On GitHub · 7
- Apr 8, 2024Azure CLI task fails: AADSTS700024: Client assertion is not within its valid time range — Azure/azure-cli65 reactions · 64 comments
- Jan 25, 2024Azure Cosmos Emulator docker image is broken — Azure/azure-cosmos-db-emulator-docker25 reactions · 23 comments
- Aug 21, 2019Support installing the latest patch or minor version — actions/setup-dotnet19 reactions · 10 comments
- Jan 31, 2024Error 404: When request Azure resource at PublishContent, zipDeploy : Failed to use /home/runner/work/_temp/temp_web_package_...zip as ZipDeploy content — Azure/functions-action18 reactions · 32 comments
- Sep 23, 2023Docs for the `.../distributedtask/securefiles` endpoint are missing from the `distributedtask` section — MicrosoftDocs/vsts-rest-api-specs18 reactions · 5 comments
2 more on GitHub
- Sep 22, 2023Azure DevOps / Azure Pipelines task (equivalent to GitHub Actions) — oven-sh/bun13 reactions · 3 comments
- Jan 14, 2020Native support for Azure DevOps Pipelines — hadolint/hadolint11 reactions · 3 comments
On Hacker News · 1
- Apr 18, 2025Tasks for Azure Pipelines1 point
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
21 rules. About 0 are common, 13 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 191
Default collections may require old domain format
- Distinctive: line 197
After uploading, create a test pipeline:
- Very specific: line 252
Update task.json if needed
- Distinctive: line 264
Create test pipeline and validate functionality
- Distinctive: line 267
Ensure all tests pass
- Very specific: line 268
Check in generated files (task.loc.json, strings)
- Very specific: line 274
Missing dependencies: Run npm install in repository root
- Very specific: line 275
Node version: Ensure Node.js 20+ is installed
- Very specific: line 276
TypeScript errors: Check tsconfig.json and update code
- Distinctive: line 277
External tool failures: Check network connectivity
- Distinctive: line 280
Mock failures: Verify mock data in Tests/ directory
- Distinctive: line 282
Tool dependencies: Ensure required tools are available
- Distinctive: line 285
Authentication: Verify PAT has correct permissions
- Distinctive: line 286
URL format: Use correct collection URL format
- Distinctive: line 287
GUID conflicts: Ensure unique GUID for test tasks
- Distinctive: line 291
Always test locally: before uploading to Azure DevOps
- Very specific: line 295
Update localization files: when changing task.json
- Distinctive: line 296
Test cross-platform: if task supports multiple OS
- Distinctive: line 308
Update package dependencies to fix versions
- Very specific: line 310
Create feature branch: CopilotSkill/CGFix/<WorkItemID>
- Very specific: line 311
Create PR with AB#<WorkItemID> for automatic Azure Boards linking
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Azure Pipelines Tasks - Copilot Instructions
This repository contains the in-the-box tasks for Azure Pipelines and Team Foundation Server. These instructions will help you understand how to build, test, and deploy tasks effectively.
Repository Overview
This repo provides open examples of how Azure Pipelines tasks are written and can help you write custom tasks for upload to your account or server. Tasks are tool runners that know how to execute tools like MSBuild, VSTest, etc., handle return codes, process stdout/stderr, write timeline records, and access credentials for Azure Pipelines integration.
Prerequisites
Required Tools
- Node.js: Version 20 or higher is required (minimum 20.17.0)
- NPM: Version 5.6.0 or higher
- TypeScript: 4.0.2 or higher (automatically validated during build)
- .NET SDK: 8.0.100 (automatically downloaded during build if needed)
Verification Commands
node -v && npm -v # Should show Node 20+ and NPM 5.6+Initial Setup
# Install repository dependencies (required before building any tasks)
npm installBuilding Tasks
Build System Overview
The repository uses a custom build system (make.js) that:
- Compiles TypeScript to JavaScript
- Handles task dependencies and external tools
- Generates localization files (
task.loc.jsonand strings) - Validates task definitions
- Copies resources to the
_builddirectory
Build Commands
Build a Specific Task (Recommended)
# From repository root
node make.js build --task <TaskName>
# Example: Build DotNetCoreCLIV2 task
node make.js build --task DotNetCoreCLIV2
# From task directory
cd Tasks/<TaskName>
npm run buildBuild All Tasks (Slow - Can Take 30+ Minutes)
npm run build
# OR
node make.js buildServer Build (For CI Environments)
node make.js serverBuild --task <TaskName>Build with Bypassed NPM Audit
node make.js build --task <TaskName> --BypassNpmAuditDebug Build (For Agent Debugging)
node make.js build --task <TaskName> --debug-agent-dir "<path-to-agent-directory>"Build Output
Built tasks are located in: _build/Tasks/<TaskName>/
The build process creates:
- Compiled JavaScript files from TypeScript source
task.jsonandtask.loc.json(localization metadata)- Resource files (PowerShell scripts, icons, etc.)
- Node modules and dependencies
- External tools and dependencies
Testing Tasks
Test Types
Unit Tests (L0)
Fast tests that mock external dependencies:
# Test specific task
node make.js test --task <TaskName> --suite L0
# Test all built tasks
npm test
# OR
node make.js testIntegration Tests (L1)
Tests that use real external tools but avoid network calls:
node make.js test --task <TaskName> --suite L1End-to-End Tests (L2)
Full integration tests with real services:
node make.js test --task <TaskName> --suite L2Legacy Tests
# All legacy tests
node make.js testLegacy
# Specific task legacy tests
node make.js testLegacy --task <TaskName>Test Debugging
Set environment variable for additional logging:
export TASK_TEST_TRACE=1
node make.js test --task <TaskName>End-to-End Testing and Deployment
Prepare Task for E2E Testing
- Modify Task GUID (Critical - Prevents Conflicts)
# Edit both task.json and task.loc.json # Change the "id" field to a unique test GUID # Use online GUID generator or: uuidgen (macOS/Linux) - Optional: Modify Task Name
# Edit task.json - change "name" field for easy YAML referencing # Example: "DotNetCoreCLI" -> "DotNetCoreCLITest" - Build the Task
node make.js build --task <TaskName>
Deploy Task to Azure DevOps
Install TFX CLI
# Linux/macOS
sudo npm install -g tfx-cli
# Windows
npm install -g tfx-cliCreate Personal Access Token
- Navigate to Azure DevOps → User Settings → Personal Access Tokens
- Click "+ New Token"
- Name your token
- Choose "Custom Defined" → Select "Environment (Read & Write)" OR "Full Access"
- Copy and save the token securely
Upload Task
Method 1: Interactive Login
# Login to Azure DevOps
tfx login
# Enter Service URL: https://<YOUR_ORGANISATION>.visualstudio.com/defaultcollection
# Enter your Personal Access Token
# Upload task
tfx build tasks upload --task-path _build/Tasks/<TaskName>Method 2: One Command Upload
tfx build tasks upload \
-u https://<YOUR_ORGANISATION>.visualstudio.com/DefaultCollection \
-t <YOUR_PERSONAL_ACCESS_TOKEN> \
--task-path _build/Tasks/<TaskName>Important Notes for Local Azure DevOps Server
- Default collections may require old domain format
- Use:
https://<YOUR_ORGANISATION>.vsts.me/DefaultCollection - Even if your org is on newer domains like
codedev.ms
Testing in Azure Pipelines
After uploading, create a test pipeline:
trigger: none
pool:
vmImage: 'ubuntu-latest'
steps:
- task: YourTestTaskName@1
inputs:
# Your task inputs hereAvailable CLI Commands
node make.js <command> [options]
Commands:
build # Build tasks for development
serverBuild # Build with full validation (CI)
buildandtest # Build and run tests
test # Run tests for built tasks
testLegacy # Run legacy tests
clean # Clean build directories
package # Package tasks for distribution
bump # Bump task versions
gendocs # Generate documentationTask Structure
Key Files
task.json- Task definition and metadatatask.loc.json- Localization template (auto-generated)package.json- Node dependencies and build scriptstsconfig.json- TypeScript configuration*.ts- TypeScript source filesTests/- Test files and test dataStrings/- Localization files
Common Dependencies
azure-pipelines-task-lib- Core task libraryazure-pipelines-tool-lib- Tool installation library- Various task-specific common packages
Development Workflow
- Setup Environment
npm install - Make Changes
- Edit TypeScript source files
- Update task.json if needed
- Add/update tests
- Build and Test
node make.js build --task <TaskName> node make.js test --task <TaskName> --suite L0 - E2E Testing
- Modify GUID in task.json and task.loc.json
- Build and upload to test Azure DevOps org
- Create test pipeline and validate functionality
- Submit Changes
- Ensure all tests pass
- Check in generated files (task.loc.json, strings)
- Submit pull request
Troubleshooting
Common Build Issues
- Missing dependencies: Run
npm installin repository root - Node version: Ensure Node.js 20+ is installed
- TypeScript errors: Check tsconfig.json and update code
- External tool failures: Check network connectivity
Common Test Issues
- Mock failures: Verify mock data in Tests/ directory
- Environment variables: Set TASK_TEST_TRACE=1 for debugging
- Tool dependencies: Ensure required tools are available
Upload Issues
- Authentication: Verify PAT has correct permissions
- URL format: Use correct collection URL format
- GUID conflicts: Ensure unique GUID for test tasks
Best Practices
- Always test locally before uploading to Azure DevOps
- Use unique GUIDs for test tasks to avoid conflicts
- Include comprehensive unit tests (L0 suite)
- Follow existing task patterns in the repository
- Update localization files when changing task.json
- Test cross-platform if task supports multiple OS
- Document task inputs/outputs in task.json descriptions
Specialized Workflows
Component Governance (CG) Bug Fixes
For fixing Component Governance security alerts, use the specialized workflow documented in .github/copilot/skills/fix-cg-bug.md.
Quick Reference:
- Retrieve work item details using Azure CLI or CG API
- Identify affected tasks via Component Governance API
- Update package dependencies to fix versions
- Bump task versions following sprint rules
- Create feature branch:
CopilotSkill/CGFix/<WorkItemID> - Create PR with
AB#<WorkItemID>for automatic Azure Boards linking
See the skill documentation for the complete 10-step workflow with examples.
Resources
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

