Hi @Arafat Mohammed ,
If you're trying to reuse YAML templates across different Azure DevOps projects, yes, it’s possible, but you need to set it up properly.
Instead of using a "Generic Git" (Other Git) connection, you need to create a Service Connection of type Azure Repos / Git.
Use the correct Service Connection
- Create a Service Connection of type Azure Repos / Git (not "Other Git").
- Go to Project Settings → Service Connections → New Service Connection → Azure Repos / Git.
- Use a PAT (Personal Access Token) with Code Read permissions.
- Approve the Service Connection for use in pipelines.
Refer this MS Document - GitHub service connection
Reference the external repository in your pipeline:
resources:
repositories:
- repository: external
type: git
name: DevOps/FrontendApp-Pipeline
endpoint: FrontendApp-Pipeline-ServiceConnection
Use the template from the external repo:
stages:
- template: templates/build.yml@external
Important checks
- Service Connection has access to the repository.
- Repository permissions allow read access.
- No need for
checkout: externalunless you want to work with the files directly.
Hope it helps!
Please do not forget to click "Accept the answer” and Yes wherever the information provided helps you, this can be beneficial to other community members.
If you have any other questions or still running into more issues, let me know in the "comments" and I would be happy to help you.