title: Azure Pipeline error: template file not found in repository
body: <p>I am trying to use 2 repositories on the same pipeline. One repository contains source code and the other has templates.</p>
  <p>The azure-pipeline.yml of repository source code looks like this:</p>
  <pre><code>
  pool: alm-aws-pool 
  
  resources: 
    repositories: 
    - repository: AzurePipelines 
      name: ALM/AzurePipelines 
      type: git 
      ref: master #branch name
  
  
  steps:
  - template: TG1_build&amp;Nuget.yml@AzurePipelines
    parameters:
      solution: '**/*.sln'
      buildPlatform: 'Any CPU'
      buildConfiguration: 'Release'
      IsNugetPrerelaseVersion: true
  </code></pre>
  <p>The template TG1_build&amp;Nuget.yml is:</p>
  <pre><code>steps:
  - task: NuGetToolInstaller@1
    displayName: 'Use NuGet 5.1.0'
    inputs:
      versionSpec: 4.0.0
  - task: NuGetCommand@2
    displayName: 'NuGet restore **/*.sln'
    inputs:
      vstsFeed: '****'
      noCache: true
  - task: sonarqube@4
    displayName: 'Prepare analysis on SonarQube'
    inputs:
      SonarQube: 'SonarQube'
      projectKey: '$(Build.Repository.Name)'
      projectName: '$(Build.Repository.Name)'
  - powershell: |
     #The double dollar is intended for using the constant $true or $false
     $isBeta=$$(IsNugetPrerelaseVersion) 
     if (-Not $isBeta) {
         exit 0;
     }
     
     $workingDirectory = &quot;$(System.DefaultWorkingDirectory)&quot;
     $filePattern = &quot;*AssemblyInfo*&quot;
     $pattern = '^(?!//)(?=\[assembly: AssemblyVersion\(&quot;(.*)&quot;\)\])'
     
     Get-ChildItem -Path $workingDirectory -Recurse -Filter $filePattern | ForEach-Object {
         $path = $_.FullName
         Write-Host $path
         (Get-Content $path) | ForEach-Object{
             if($_ -match $pattern){
                 # We have found the matching line
                 # Edit the version number and put back.
                 $fileVersion = $matches[1]
                 $newVersion = &quot;$fileVersion-beta&quot;
                 '[assembly: AssemblyVersion(&quot;{0}&quot;)]{1}[assembly: AssemblyInformationalVersion(&quot;{2}&quot;)]' -f $fileVersion,&quot;`r`n&quot;,$newVersion 
             } else {
                 # Output line as is
                 $_
             }
         } | Set-Content $path
     }
     
     $filePattern = &quot;**.csproj*&quot;
     $pattern1 =&quot;&lt;Version&gt;&quot;
     $pattern2 =&quot;&lt;/Version&gt;&quot;
     $pattern = '(?={0})' -f $pattern1
     $empty = &quot;&quot;
     
     Get-ChildItem -Path $workingDirectory -Recurse -Filter $filePattern | ForEach-Object {
         $path = $_.FullName
         Write-Host $path
         (Get-Content $path) | ForEach-Object{
             if($_ -match $pattern){
                 # We have found the matching line
                 # Edit the version number and put back.
                 $fileVersion = $_
                 $fileVersion = $fileVersion -replace $pattern1, $empty
                 $fileVersion = $fileVersion -replace $pattern2, $empty
                 $fileVersion = $fileVersion.Trim()
                 $newVersion = &quot;$fileVersion-beta&quot;
                 '&lt;Version&gt;{0}&lt;/Version&gt;' -f $newVersion
             } else {
                 # Output line as is
                 $_
             }
         } | Set-Content $path
     }
    displayName: 'Update Assembly Info for nuget generation'
  - task: VSBuild@1
    displayName: 'Build solution **\*.sln'
    inputs:
      msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation=&quot;$(BuildConfiguration)-binaries.zip&quot; /p:RunCodeAnalaysis=true'
      platform: '$(BuildPlatform)'
      configuration: '$(BuildConfiguration)'
      clean: true
      maximumCpuCount: true
      msbuildArchitecture: x64
      createLogFile: true
  - task: NuGetCommand@2
    displayName: 'NuGet pack'
    inputs:
      command: pack
      packagesToPack: '$(SearchPatternToPack)'
      packDestination: '$(Build.ArtifactStagingDirectory)/nugets'
      includeReferencedProjects: true
  </code></pre>
  <p>When I try to ran this pipeline I found this error:
  /azure-pipelines.yml: File /TG1_build&amp;Nuget.yml not found in repository <a href="https://dev.azure.com/Fabrikam/ALM/_git/AzurePipelines" rel="nofollow noreferrer">https://dev.azure.com/Fabrikam/ALM/_git/AzurePipelines</a> branch refs/heads/master version d6d59eef922dac0324654b49a71037a504102ff4</p>
  <p>Someone can help us!</p>
  <p>Thank you</p>