| Crates.io | azdolint |
| lib.rs | azdolint |
| version | 0.3.0 |
| created_at | 2026-01-11 10:47:09.479758+00 |
| updated_at | 2026-01-12 20:45:14.726761+00 |
| description | CLI tool that validates Azure DevOps pipeline YAML files by checking that referenced variable groups and variables exist |
| homepage | https://github.com/dariuszparys/azdo-linter |
| repository | https://github.com/dariuszparys/azdo-linter |
| max_upload_size | |
| id | 2035537 |
| size | 179,140 |
A command-line tool that validates Azure DevOps pipeline YAML files by checking that all referenced variable groups and variables actually exist in Azure DevOps.
${{ if ... }}) and map-syntax variablesThis tool requires a Personal Access Token (PAT) from Azure DevOps with appropriate permissions.
Create a PAT in Azure DevOps:
Store the PAT securely:
export AZDO_PAT=your-token-here--pat flag (not recommended for scripts)cargo install azdolint
# Clone the repository
git clone https://github.com/dariuszparys/azdo-linter.git
cd azdo-linter
# Build the project
cargo build --release
# The binary will be available at target/release/azdolint
cargo install --path .
azdolint --pipeline-file <PATH> --organization <ORG> --project <PROJECT> [OPTIONS]
| Argument | Short | Description |
|---|---|---|
--pipeline-file |
-p |
Path to the Azure DevOps pipeline YAML file to validate |
--organization |
-o |
Azure DevOps organization name or URL |
--project |
-j |
Azure DevOps project name |
--pat |
-t |
Personal Access Token for Azure DevOps API authentication (or set AZDO_PAT env var) |
--pipeline-name |
-n |
Optional: Pipeline name in Azure DevOps (enables pipeline definition variable validation) |
--pipeline-id |
-i |
Optional: Pipeline ID in Azure DevOps (more reliable than name, find it in URL as pipelineId=XXX) |
--verbose |
-v |
Enable verbose output for debugging |
Using environment variable (recommended):
export AZDO_PAT=your-personal-access-token
azdolint --pipeline-file azure-pipelines.yml --organization myorg --project myproject
Using --pat flag:
azdolint -p azure-pipelines.yml -o myorg -j myproject --pat $AZDO_PAT
With full organization URL:
azdolint -p azure-pipelines.yml -o https://dev.azure.com/myorg -j myproject
Verbose output:
azdolint -p azure-pipelines.yml -o myorg -j myproject --verbose
With pipeline definition variable validation:
azdolint -p azure-pipelines.yml -o myorg -j myproject --pipeline-id 42
Or using pipeline name:
azdolint -p azure-pipelines.yml -o myorg -j myproject --pipeline-name "My Pipeline"
The validator uses the following exit codes for CI/CD integration:
| Exit Code | Meaning |
|---|---|
0 |
Success - All variable groups and variables exist |
1 |
Validation failure - Some variable groups or variables were not found |
2 |
Error - Could not complete validation (e.g., authentication failed, file not found) |
# Azure DevOps Pipeline
# Store your PAT as a secret variable named 'AZDO_PAT' in your pipeline or variable group
steps:
- script: |
azdolint --pipeline-file azure-pipelines.yml \
--organization $(System.CollectionUri) \
--project $(System.TeamProject) \
--pat $(AZDO_PAT)
displayName: 'Validate Pipeline Variables'
env:
AZDO_PAT: $(AZDO_PAT)
Azure DevOps Pipeline Validator
================================
Variable Groups
---------------
[PASS] Variable group 'ProductionSecrets' exists
[PASS] Variable group 'DatabaseConfig' exists
Variable References
-------------------
[PASS] Variable 'ConnectionString' found in group 'DatabaseConfig'
[PASS] Variable 'ApiKey' found in group 'ProductionSecrets'
================================
RESULT: PASSED
All 4 check(s) passed successfully.
================================
Azure DevOps Pipeline Validator
================================
Variable Groups
---------------
[PASS] Variable group 'ProductionSecrets' exists
[FAIL] Variable group 'MissingGroup' not found
Suggestion: Create the variable group in Azure DevOps at:
https://dev.azure.com/myorg/myproject/_library?itemType=VariableGroups
Variable References
-------------------
[PASS] Variable 'ApiKey' found in group 'ProductionSecrets'
[FAIL] Variable 'UndefinedVar' not found in any referenced group
Suggestion: Add this variable to one of the referenced variable groups,
or verify the variable name is spelled correctly.
================================
RESULT: FAILED
2 of 4 check(s) failed.
================================
When validating variable references, the tool checks three sources in priority order:
--pipeline-id or --pipeline-name)This means if a variable is defined in multiple places, the tool will find it and consider it valid. To enable pipeline definition variable validation, provide either --pipeline-id (recommended) or --pipeline-name.
Note: Using --pipeline-id is more reliable than --pipeline-name as it avoids potential issues with special characters or duplicate pipeline names. You can find the pipeline ID in the Azure DevOps URL as pipelineId=XXX.
The validator supports the following variable definition formats in Azure DevOps YAML:
variables:
- group: 'MyVariableGroup'
# List format
variables:
- name: BuildConfiguration
value: 'Release'
# Map format
variables:
BuildConfiguration: 'Release'
The validator detects variable references using the $(variableName) syntax anywhere in the pipeline YAML.
variables:
- ${{ if eq(parameters.environment, 'prod') }}:
- group: 'ProductionSecrets'
- ${{ else }}:
- group: 'DevelopmentSecrets'
Variables defined at stage or job level are properly scoped and validated:
stages:
- stage: Build
variables:
- group: 'BuildSecrets'
jobs:
- job: BuildJob
variables:
- name: JobVar
value: 'value'
Template files are automatically detected (files with parameters: but no trigger:). When run against a template directly, the linter shows a warning and skips validation. Templates are validated in the context of the parent pipeline that includes them.
MIT License
Contributions are welcome! Please feel free to submit a Pull Request.