Implement a package management strategy in pipelines
Learning objectives: integrate packaging with CI/CD — restore dependencies from feeds, build, and publish packages — using Azure Pipelines tasks and the Azure Artifacts service connection.
Overview
The automation layer of dependency management: wiring packaging into pipelines so every commit flows through restore → build → test → package → publish against your feeds, and downstream release pipelines consume published packages.
Concepts introduced (link to term notes)
Units
- Add the Azure Artifacts service connection for feed auth
- Restore dependencies in CI (NuGet restore /
npm ci/ pip / Maven) - Publish packages from the pipeline to a feed
- Version packages with SemVer/build ID
- Conditional publishing (main/release branches only; prerelease views)
- Consume published packages in release pipelines
Key terms & commands
Azure Artifacts service connection · DotNetCoreCLI@2 (restore/publish) · NuGet@1 · Npm@1 · PublishPipelineArtifact vs. feed publish · pip install · package-lock.json
Hands-on
Add a pipeline that restores from a feed (upstream-supplied), builds, and conditionally publishes a SemVer package to a feed view on the main branch.
Exam focus
- Authenticate via the Azure Artifacts service connection, never checked-in credentials.
- Publish from main/release branches only; feature branches publish to a prerelease view or not at all.
- Feed package versions are immutable — versioning must be unique per publish.
- Distinguish publishing packages to a feed vs. publishing pipeline build artifacts.
Related
Path MOC · intro-dependency-management · azure-artifacts-feeds · upstream-and-versioning