Microsoft Certified: DevOps Engineer ExpertDesign and implement source controlMedium
A team is developing a complex application with several independent components, each residing in its own Git repository within the same Azure DevOps project. A build pipeline for the main application needs to checkout code from its primary repository and also from two other component repositories to compile and package the final application. The team wants to ensure that all required repositories are available at build time without manually cloning them in the script. Which feature should they use in their Azure Pipelines YAML definition?
- ASubmodules
- BPackage management feeds
- CMulti-repo checkout
- DGit Large File Storage (LFS)
Show answer & explanationAnswer & explanation
Correct answer: C. Multi-repo checkout
Azure Pipelines' multi-repo checkout feature allows a single pipeline to checkout multiple Git repositories. By defining additional repositories in the `resources.repositories` section and using the `checkout` step, all necessary codebases can be made available to the build agent automatically.
Why the other options are wrong
- A. Git submodules are a Git feature for embedding repositories, but multi-repo checkout is the native Azure Pipelines way to achieve this at the pipeline level.
- B. Package management feeds are for distributing compiled binaries, not for checking out source code from multiple repositories.
- D. Git LFS is for managing large binary files in Git, not for checking out multiple repositories.
Azure Pipelines Multi-repo Checkout
A feature in Azure Pipelines that enables a single pipeline to checkout code from multiple Git repositories (within the same or different organizations) into the build agent's workspace.
- Defined using `resources.repositories` in YAML.
- Supports Git repositories from Azure Repos, GitHub, or other Git sources.
- Each repository is checked out into a separate directory.
- Simplifies building applications with dependencies across multiple repositories.
Memory trick: Multiple repos, checkout them all at once.