Azure Pipelines Template Debugger

June 6, 2026 ยท View on GitHub

CI codecov

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

Installation

Note: This extension is currently in development and not yet published to the marketplace.

  1. Clone the repository
  2. Run yarn install to install dependencies
  3. Press F5 to open the Extension Development Host with the sample pipelines loaded
  4. Pick a launch config from the Run and Debug panel and start debugging

Usage

  1. Open any Azure Pipelines YAML file
  2. Set breakpoints by clicking the gutter
  3. Open the Run and Debug panel and select an azurepipelines launch config
  4. Press F5 to start debugging
ActionShortcutDescription
Step InF11Enter a template: reference or dive into a block
Step OverF10Execute a template reference without entering it
Step OutShift+F11Return from the current template to the caller
ContinueF5Resume to the next breakpoint
RestartCtrl+Shift+F5Re-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
}
PropertyTypeRequiredDescription
pipelinestringโœ…Absolute path to the pipeline YAML file
stopOnEntrybooleanPause on the first line (default: false)
parametersstringPath 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

FileDemonstrates
azure-pipelines.ymlParameters, variables, template includes, if/elseif/else, each loops
extends-pipeline.ymlextends: template: with [extends] call stack frames
templates/build-steps.ymlStep In/Out, conditionals inside templates, hover & watch
templates/deploy-steps.ymlPer-region deployment from each loop, conditional steps
templates/base-pipeline.ymlBase template for extends with nested includes
templates/shared-variables.ymlVariable template

๐Ÿ—บ๏ธ Roadmap

  • ๐Ÿ”œ Remote template resolution for resources.repositories references 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.