I'm trying to use a template that's stored in another Git repository in Azure DevOps where that template has a reference to a script also contained within that repository. While I can successfully use the template from the main pipeline it doesn't reference the script the template requires.
Is there some way I can do this please?
The HelloWorld template/script are stored in Azure DevOps Repo 'HelloWorld' in a sub-folder called 'Templates'.
HelloWorld.ps1 script in the same directory as the below template.
param($Name)
Write-Host "Hello, $Name!"
Template #1 with reference to local script
parameters:
- name: azureSubscription
type: string
- name: name
type: string
jobs:
- job: HelloWorld
displayName: Hello World
variables:
name: ${{ parameters.name }}
steps:
- task: AzurePowerShell@4
name: HelloWorld
displayName: Hello World
inputs:
azureSubscription: ${{ parameters.azureSubscription }}
scriptType: filePath
scriptPath: ./HelloWorld.ps1
azurePowerShellVersion: latestVersion
failOnStandardError: true
scriptArguments:
-Name "$(name)"
Template #2
resources:
repositories:
- repository: helloworld
type: git
name: HelloWorld
stages:
- stage: Variables
jobs:
- template: Scripts/hello-world.yml@helloworld
parameters:
azureSubscription: 'My Subscription'
name: 'Billy'


