azure-pipelines-agent
Copilot instructions1.9k starsChanged 3 months agoMITView on GitHub
This repository contains the Azure Pipelines Agent, a cross-platform build and release agent written in C# for .NET Core. When working with this codebase, follow these guidelines and use the provided development tools. All commands should be run from the src/ directory: Follow the .NET Foundation coding guidelines:
- Installs packages
- Commits and pushes
Trending
Quiet this year.thin dataabout the whole repository
Who's talking about microsoft/azure-pipelines-agent
- hashicorp/terraform“Enable matching of uppercase environment variables”GitHub · Sep 3, 2019 · 73 reactions
- actions/actions-runner-controller“Dealing with jobs failing with "lost communication with the server" errors”GitHub · Apr 19, 2021 · 30 reactions
- microsoft/azure-pipelines-tasks“%25 detected in ##vso command in some Tasks”GitHub · Jan 28, 2021 · 25 reactions
- microsoft/azure-pipelines-yaml“Running jobs locally”GitHub · Oct 30, 2018 · 25 reactions
- Azure/WALinuxAgent“[BUG] WALinuxAgent service should start after the cloud-config service”GitHub · Jul 8, 2020 · 13 reactions
The biggest 5 of 12 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 12
Talked about on GitHub (12 times).
On GitHub · 12
- Sep 3, 2019Enable matching of uppercase environment variables — hashicorp/terraform73 reactions · 9 comments
- Apr 19, 2021Dealing with jobs failing with "lost communication with the server" errors — actions/actions-runner-controller30 reactions · 14 comments
- Jan 28, 2021%25 detected in ##vso command in some Tasks — microsoft/azure-pipelines-tasks25 reactions · 30 comments
- Oct 30, 2018Running jobs locally — microsoft/azure-pipelines-yaml25 reactions · 7 comments
- Jul 8, 2020[BUG] WALinuxAgent service should start after the cloud-config service — Azure/WALinuxAgent13 reactions · 18 comments
7 more on GitHub
- Oct 30, 2018Support conditions for templates — microsoft/azure-pipelines-yaml10 reactions · 54 comments
- Jul 9, 2019Skip PR builds via commit message — Azure/azure-sdk8 reactions · 9 comments
- Mar 4, 2019How to check each command in a multi-line script for failure — microsoft/azure-pipelines-yaml8 reactions · 2 comments
- Nov 29, 2018Please add Process Parameters — microsoft/azure-pipelines-yaml8 reactions · 10 comments
- Jul 28, 2021Azure Service bus "azurerm_servicebus_queue_authorization_rule" : Provider produced inconsistent result after apply — hashicorp/terraform-provider-azurerm6 reactions · 3 comments
- Dec 11, 2019Instructs the pipeline it's ok to save cache on partial builds? — microsoft/azure-pipelines-tasks6 reactions · 4 comments
- Dec 25, 2020Pipes appear to not pass on EOF on macOS runners — actions/runner5 reactions · 13 comments
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
16 rules. About 0 are common, 10 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 7
Source Code: All source code is in the src/ directory
- Very specific: line 8
Build Scripts: Use src/dev.sh (Linux/macOS) or src/dev.cmd (Windows)
- Very specific: line 26
All commands should be run from the src/ directory:
- Distinctive: line 98
Add custom test filters as the 5th parameter:
- Distinctive: line 106
Run the agent with debug mode:
- Distinctive: line 134
Follow the .NET Foundation coding guidelines:
- Distinctive: line 136
Use PascalCase for public members
- Distinctive: line 137
Use camelCase for private fields
- Distinctive: line 139
Keep methods focused and small
- Very specific: line 145
Create/modify source files in appropriate src/ subdirectories
- Very specific: line 146
Add unit tests in src/Test/
- Distinctive: line 148
Update documentation if needed
- Very specific: line 152
Missing dependencies: Run ./dev.sh layout to restore
- Distinctive: line 153
Test failures: Check platform-specific test filters
- Distinctive: line 170
Always run layout first: when starting development
- Distinctive: line 172
Run tests: before committing to catch regressions
≈ “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
GitHub Copilot Instructions for Azure Pipelines Agent
This repository contains the Azure Pipelines Agent, a cross-platform build and release agent written in C# for .NET Core. When working with this codebase, follow these guidelines and use the provided development tools.
Project Structure
- Source Code: All source code is in the
src/directory - Build Scripts: Use
src/dev.sh(Linux/macOS) orsrc/dev.cmd(Windows) - Agent Layout: Built agent is placed in
{root}/{runtime_id}/_layout - Documentation: Available in
docs/directory
Development Workflow
Initial Setup
# Clone and navigate to source
git clone https://github.com/microsoft/azure-pipelines-agent
cd ./src
# First time setup - creates full agent layout
./dev.sh layoutBuild Commands
All commands should be run from the src/ directory:
Linux/macOS
./dev.sh {command} [target_framework] [build_config] [runtime_id] [test_filters]Windows
dev {command} [target_framework] [build_config] [runtime_id] [test_filters]Available Commands
| Command | Short | Description |
layout | l | Create full agent layout in {root}/{runtime_id}/_layout (run first time) |
build | b | Build everything and update agent layout folder |
test | t | Build agent binaries and run unit tests for current platform |
testl0 | l0 | Run L0 (unit) tests only |
testl1 | l1 | Run L1 (integration) tests only |
package | p | Create distribution packages |
hash | Generate hash files | |
report | Generate test reports | |
lint | Run code linting | |
lint-verify | Verify linting rules |
Normal Development Flow
# 1. Initial layout (first time only)
./dev.sh layout
# 2. Make code changes
# ... edit files ...
# 3. Build and test
./dev.sh build
./dev.sh test
# 4. Commit changes
git add .
git commit -m "Your changes"
git pushProject Details
Technology Stack
- Language: C# (.NET Core)
- Target Framework: net10.0 (default), net8.0 supported
- Platforms: Windows (x64, x86, ARM64), macOS (x64, ARM64), Linux (x64, ARM)
- Build System: MSBuild with custom scripts
Key Components
- Agent.Listener: Main agent listener service
- Agent.Worker: Task execution worker
- Agent.PluginHost: Plugin hosting environment
- Agent.Plugins: Built-in plugins
- Agent.Sdk: SDK for agent development
Dependencies
- .NET SDK: Automatically downloaded if not present
- Git: Required for development (Git for Windows on Windows)
- Node.js: For certain pipeline tasks
Testing
Test Types
- L0 Tests: Unit tests (
./dev.sh testl0) - L1 Tests: Integration tests (
./dev.sh testl1)
Test Filters
Add custom test filters as the 5th parameter:
./dev.sh test net6.0 Debug osx-arm64 "TestCategory=YourCategory"Debugging
Debug Mode
Run the agent with debug mode:
./config.sh --debug
./run.sh --debugEnvironment Variables for Debugging
VSTSAGENT_DEBUG_TASK: Debug specific tasks by ID or name+version
Build Configurations
Available Configurations
- Debug: Development builds with debug symbols
- Release: Production builds optimized for performance
Runtime IDs
Common runtime identifiers:
win-x64,win-x86,win-arm64osx-x64,osx-arm64linux-x64,linux-arm,linux-arm64rhel.6-x64
Package Types
agent(default): Full agent packagepipelines-agent: Pipelines-specific package (excludes Node 6/10)
Code Style
Follow the .NET Foundation coding guidelines:
- Use PascalCase for public members
- Use camelCase for private fields
- Use meaningful names
- Keep methods focused and small
- Include XML documentation for public APIs
Common Tasks
Adding New Features
- Create/modify source files in appropriate
src/subdirectories - Add unit tests in
src/Test/ - Build and test:
./dev.sh build && ./dev.sh test - Update documentation if needed
Troubleshooting Build Issues
- "unzip not found": Install unzip (
sudo apt install unzipon WSL) - Missing dependencies: Run
./dev.sh layoutto restore - Test failures: Check platform-specific test filters
Working with Agent Layout
The built agent in _layout/ can be used for:
- Local testing and debugging
- Manual agent installation
- Testing pipeline integration
To configure and run the built agent:
cd {root}/{runtime_id}/_layout
./config.sh
./run.shBest Practices
- Always run layout first when starting development
- Build before testing to ensure latest changes are included
- Run tests before committing to catch regressions
- Use appropriate runtime ID for your target platform
- Follow the normal dev flow for consistent results
Additional Resources
- Contributing Guide
- Azure DevOps Agent Documentation
- Self-hosted Agent Installation
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.

