Azure Pipelines Template Debugger
June 6, 2026 ยท View on GitHub
Understand your templates, one step at a time.
Azure Pipelines Template Debugger is a VS Code extension that lets you set breakpoints in Azure Pipelines YAML files and step through template expansion โ seeing how parameters flow, how ${{ }} expressions resolve, and which conditional branches are taken โ all without executing any pipeline tasks.
๐ฏ Goals and principles
- Template expansion, not task execution โ we simulate Azure DevOps' compile-time template processing, not the pipeline runtime.
- Familiar debugging UX โ breakpoints, call stack, variables, watch, hover, step in/out work exactly like they do for code.
- Offline by default โ everything runs locally against files on disk. No Azure DevOps connection required.
โจ Features
๐ Step through template expansion โ walk through your pipeline YAML node by node with Step In, Step Over, and Step Out
๐ Template include stack โ the Call Stack shows the full chain of template: includes and extends: references
๐งฎ Expression evaluation โ ${{ }} compile-time expressions are evaluated in real time with 17+ built-in functions (eq, ne, contains, format, coalesce, and more)
๐ Conditional stepping โ step through ${{ if }} / ${{ elseif }} / ${{ else }} blocks and see which branch is taken
๐ Loop iteration โ ${{ each }} loops are unrolled one iteration at a time with the loop variable visible in the Variables pane
๐ Breakpoints with conditions โ set conditional breakpoints like eq(parameters.environment, 'production') to stop only when it matters
๐๏ธ Watch & hover โ add watch expressions or hover over ${{ }} text to see resolved values
โ๏ธ Inline values โ resolved expression values appear as inline decorations in the editor while paused
๐ Parameters & variables scopes โ inspect parameters (with defaults), variables, and template expressions for each stack frame
๐ Restart โ restart template expansion from the root pipeline without relaunching
๐ Getting Started
Prerequisites
- VS Code 1.92+
- Azure Pipelines extension (installed automatically as a dependency)
Installation
Note: This extension is currently in development and not yet published to the marketplace.
- Clone the repository
- Run
yarn installto install dependencies - Press F5 to open the Extension Development Host with the sample pipelines loaded
- Pick a launch config from the Run and Debug panel and start debugging
Usage
- Open any Azure Pipelines YAML file
- Set breakpoints by clicking the gutter
- Open the Run and Debug panel and select an
azurepipelineslaunch config - Press F5 to start debugging
| Action | Shortcut | Description |
|---|---|---|
| Step In | F11 | Enter a template: reference or dive into a block |
| Step Over | F10 | Execute a template reference without entering it |
| Step Out | Shift+F11 | Return from the current template to the caller |
| Continue | F5 | Resume to the next breakpoint |
| Restart | Ctrl+Shift+F5 | Re-run expansion from the root pipeline |
Launch Configuration
Add to your .vscode/launch.json:
{
"type": "azurepipelines",
"request": "launch",
"name": "Debug pipeline",
"pipeline": "${workspaceFolder}/azure-pipelines.yml",
"stopOnEntry": true
}
| Property | Type | Required | Description |
|---|---|---|---|
pipeline | string | โ | Absolute path to the pipeline YAML file |
stopOnEntry | boolean | Pause on the first line (default: false) | |
parameters | string | Path to a YAML file with parameter value overrides |
๐ Architecture
The extension implements the Debug Adapter Protocol in-process (no separate DAP server). The main components are:
extension.ts โ activation: registers providers
โโโ configurationProvider.ts โ resolves launch configs
โโโ debugAdapterFactory.ts โ creates DebugSession instances
โโโ inlineValuesProvider.ts โ inline ${{ }} value decorations
โ
debugSession.ts โ DAP request/response handling
โโโ debugger.ts โ core execution engine
โโโ documentManager.ts โ YAML loading & caching
โ โโโ fileLoader.ts โ file I/O + YAML parsing
โโโ documentTraverser.ts โ AST walking, template/if/each handling
โโโ executionContextManager.ts โ call stack (context per template)
โ โโโ executionContext.ts โ pointer, params, variables, depth
โโโ breakpointManager.ts โ breakpoints + conditional evaluation
โโโ eventManager.ts โ debugger events โ DAP events
โโโ expressionEngine/ โ ${{ }} expression evaluator
โโโ lexer.ts โ tokenizer
โโโ parser.ts โ token โ AST
โโโ evaluator.ts โ AST โ resolved value
โโโ functions.ts โ built-in functions (eq, ne, etc.)
โโโ types.ts โ Token, AST node, context types
๐ ๏ธ Development
๐ Requirements
Build & Test
yarn install # install dependencies
yarn run compile # build (tsc โ out/)
yarn run lint # eslint
yarn run test:unit # expression engine tests (mocha, no VS Code host)
yarn run test # VS Code integration tests
Running the Extension
Press F5 in VS Code โ it compiles the extension and opens a new Extension Development Host window with the sample/ folder loaded. The sample folder contains pipelines that exercise every debugger feature (parameters, template includes, conditionals, loops, extends).
Sample Pipelines
| File | Demonstrates |
|---|---|
azure-pipelines.yml | Parameters, variables, template includes, if/elseif/else, each loops |
extends-pipeline.yml | extends: template: with [extends] call stack frames |
templates/build-steps.yml | Step In/Out, conditionals inside templates, hover & watch |
templates/deploy-steps.yml | Per-region deployment from each loop, conditional steps |
templates/base-pipeline.yml | Base template for extends with nested includes |
templates/shared-variables.yml | Variable template |
๐บ๏ธ Roadmap
- ๐ Remote template resolution for
resources.repositoriesreferences within the same Azure DevOps organization - ๐ Parameter type validation against declared types (
string,number,boolean,object,stepList, etc.) - ๐ Loaded sources tracking (see all template files involved in expansion)
๐ค Contributing
Contributions are welcome! Feel free to fork the repo and submit pull requests. If you have ideas but aren't familiar with the code, you can also open issues.
๐ License
See the LICENSE file for more details.