Template file not found CI/CD Origin: Build & delivery Last updated 25 Oct 2026

Azure Pipelines: /azure-pipelines.yml: File /templates/build.yml not found in repository / Unable to find template

The YAML references a template (template: templates/build.yml) that Azure cannot find — wrong path, repo resource or branch.

Exact message you may see File not found in repository templateUnable to find template Azure Pipelines/azure-pipelines.yml: File /templates/build.yml not found in repositoryA template expression is not allowed in this context
Seen on: Azure Pipelines

Meaning

Template paths are relative to the file that references them, unless they start with / (repo root). Templates in other repositories need a resources: repositories: entry and @alias. The branch the pipeline runs on must contain the file.

Common causes

  • Relative path wrong from the current file
  • Leading / used but file is elsewhere
  • Repository resource not declared or wrong ref
  • File exists on a different branch only
  • Typo in file name or case on Linux agents

⚡ Quick fix

  1. Fix the path relative to the current file or use / from repo root
  2. Declare resources.repositories and use template: file.yml@alias
  3. Commit the template to the branch being built

Detailed fix by platform

Azure DevOps

  1. Reference: - template: templates/build.yml@shared after resources: repositories: - repository: shared; type: git; name: Project/shared-repo

Code examples

Template from another repo

yaml
resources:
  repositories:
    - repository: shared
      type: git
      name: MyProject/shared-templates
steps:
  - template: build.yml@shared

How to diagnose

  1. Path — Relative or from root?
  2. Repo — Resource declared?
  3. Branch — File exists on this branch?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):

.gitlab-ci.yml invalid — GitLab CI: Found errors in your .gitlab-ci.yml: jobs:build config contains unknown keys: scripts (CI/CD).gitlab-ci.yml invalidCannot find orb — CircleCI: Cannot find orb 'circleci/node@9.9.9'. Check the namespace and version exist (CI/CD)Cannot find orbComparisonError: manifest generation failed — Argo CD: ComparisonError: rpc error: code = Unknown desc = Manifest generation error (cached): kustomize build failed (CI/CD)ComparisonError: mani…Config compilation failed — CircleCI: Error calling workflow: 'build'. Cannot find a definition for job named test / Config does not conform to schema (CI/CD)Config compilation fa…Container exceeded memory limit — Bitbucket Pipelines: Container 'Build' exceeded memory limit / Docker container exited with code 137 (CI/CD)Container exceeded me…error parsing called workflow — GitHub Actions: error parsing called workflow ".github/workflows/ci.yml" -> "org/repo/.github/workflows/build.yml@main": workflow was not found (CI/CD)error parsing called …No such DSL method — Jenkins: java.lang.NoSuchMethodError: No such DSL method 'dockerBuild' found among steps (CI/CD)No such DSL methodScripts not permitted to use method — Jenkins: org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method java.lang.String toUpperCase (CI/CD)Scripts not permitted…Template …

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.