Lesson 1 of 4 Package Management

Choosing Azure Artifacts or GitHub Packages

This lesson explains why organizations manage packages, and compares the two platforms.

Learning outcomes

After completing this lesson, you will be able to:

  • Explain the benefits of a managed feed.
  • Describe Azure Artifacts and its package types.
  • Describe GitHub Packages and how workflows use it.
  • Recommend a package platform.

What package management solves

A modern application uses many libraries, written by its own organization and by others. A package bundles such code with metadata, including a name, a version and its dependencies. A package manager, such as NuGet, npm, Maven or pip, resolves and downloads these packages. A feed or registry is the server from which they come.

Without a managed feed, teams copy files between repositories, depend directly on public registries, and have no record of what they consume. A managed feed gives three benefits. It offers a single trusted source, which lets teams share internal libraries with proper versions. It protects builds against a public registry being unavailable, or against a package being removed. It also gives a control point, where an organization can decide what may be used.

Select all that apply

Why use a managed feed?

Exam skills 3.1.1

Pick the benefits that a managed package feed gives an organization.

Log in to try this activity Interactive activities are free with an account.

Azure Artifacts

Azure Artifacts is the package service in Azure DevOps. It hosts feeds, which may be scoped to a project or an organization. It supports NuGet, npm, Maven, Python, Cargo and Universal Packages, which store arbitrary files, such as tools or large assets, and are managed with the Azure CLI.

Each organization receives 2 GiB of free storage, and additional storage is billed on use. Feed permissions use roles, namely Feed Reader, Feed and Upstream Reader (Collaborator), Feed Publisher (Contributor) and Feed Owner (Administrator), and pipelines reach a feed through the Build Service identity. In a pipeline, authentication tasks such as NuGetAuthenticate@1 and npmAuthenticate@0 configure the package client, so no credentials are written into the repository.

Azure Artifacts has two features that often decide an exam scenario: upstream sources, which bring public packages through a feed, and views, which release packages at different quality levels. The next lesson explains both.

Match the pairs

Azure Artifacts feed roles

Exam skills 3.1.1

Match each Azure Artifacts feed role with what it allows.

Log in to try this activity Interactive activities are free with an account.

GitHub Packages

GitHub Packages hosts packages beside the source code, and links them to a repository or an organization. It supports npm, NuGet, Maven, Gradle, RubyGems and containers through the GitHub Container Registry at ghcr.io. Workflows authenticate with GITHUB_TOKEN, given the packages: write permission, so publishing needs no separate credential. Public packages are free, and private packages share a storage and data transfer allowance according to plan.

permissions:
  contents: read
  packages: write

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          registry-url: https://npm.pkg.github.com
      - run: npm ci
      - run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
True or false

Publishing to GitHub Packages

Exam skills 3.1.1

Check how workflows publish to GitHub Packages.

Log in to try this activity Interactive activities are free with an account.

Choosing a package platform

The following comparison summarizes the decision. Neither platform is better in general, and the deciding factors are where the code lives, and whether upstream sources and views are needed. Container images are a separate decision: for images deployed to Azure, Azure Container Registry offers geo-replication, private endpoints and integration with Azure Kubernetes Service.

Azure Artifacts
Best fitAzure DevOps organizations
FormatsNuGet, npm, Maven, Python, Cargo, Universal
Python packagesSupported
Upstream sourcesYes
Quality viewsYes
Pipeline identityBuild Service identity
Choose when You need upstream caching, views or Python packages.
GitHub Packages
Best fitCode and workflows on GitHub
Formatsnpm, NuGet, Maven, Gradle, RubyGems, containers
Python packagesNot supported
Upstream sourcesNo equivalent feature
Quality viewsNo equivalent feature
Pipeline identityGITHUB_TOKEN
Choose when You want packages beside GitHub repositories.

The following diagram compares two package platforms for internal Python packages.

Choosing a package platform for internal Python packages on GitHub-hosted code. GitHub Packages supports neither Python packages nor upstream sources. Azure Artifacts does both: a feed with PyPI as an upstream saves public packages on first use, and a GitHub workflow authenticates to the feed to publish.
The scenario is illustrative.
Sort into groups

Azure Artifacts or GitHub Packages?

Exam skills 3.1.1

Choose the package platform each requirement points to.

Log in to try this activity Interactive activities are free with an account.
Worked example

Recommending a tool

A company hosts all its code on GitHub Enterprise Cloud. Its developers publish internal Python packages, and security requires that public packages are retained internally in case they are removed from PyPI. Which package platform should you recommend?

The company should use Azure Artifacts, even though its code is on GitHub. GitHub Packages does not support Python packages, and it has no upstream source feature, whereas an Azure Artifacts feed with PyPI as an upstream saves packages when they are first used. A GitHub workflow can authenticate to the feed and publish there. Storing wheels in Git LFS would provide no dependency resolution, and would require a custom process.

Check yourself

Which Azure Artifacts package type suits arbitrary files such as a tool bundle?

Show answer

Universal Packages. They store any files, and are managed with the Azure CLI.

Exam Tips

Remember for the exam

  • A feed gives a trusted source, protection from outages and a control point.
  • Azure Artifacts supports NuGet, npm, Maven, Python, Cargo and Universal Packages.
  • GitHub Packages does not host Python packages.
  • Azure Artifacts has 2 GiB free per organization.
  • Workflows publish to GitHub Packages with GITHUB_TOKEN and packages: write.