Microsoft Certified: DevOps Engineer ExpertDesign and implement source controlMedium

A company is implementing a new package management strategy using Azure Artifacts. They have a public upstream source (nuget.org) and also publish their own internal NuGet packages. They want to configure their feed to prioritize their internal packages over public packages when a package with the same name exists in both sources, and also ensure that all public packages are cached for faster access. Which configuration should they apply to their Azure Artifacts feed?

  1. AUse a single feed, adding nuget.org as an upstream source, and manually push all public packages to the feed.
  2. BCreate two separate feeds: one for internal packages and one for cached public packages.
  3. CSet nuget.org as an upstream source with a view, and store internal packages in a separate feed.
  4. DConfigure the feed to use 'Local packages first' behavior and add nuget.org as an upstream source.
Show answer & explanation

Correct answer: D. Configure the feed to use 'Local packages first' behavior and add nuget.org as an upstream source.

Configuring an Azure Artifacts feed with 'Local packages first' behavior ensures that packages published directly to the feed are prioritized over packages from upstream sources. Adding nuget.org as an upstream source allows public packages to be fetched and automatically cached when first requested, meeting both requirements.

Why the other options are wrong

  • A. Manually pushing all public packages is impractical, inefficient, and defeats the purpose of upstream sources which handle caching automatically.
  • B. Creating two separate feeds would require consumers to configure multiple feeds, which is less efficient than a single feed with upstream sources.
  • C. Using views doesn't directly control prioritization between local and upstream sources with the same name, and storing internal packages separately would complicate consumption.

Azure Artifacts Upstream Sources

Sources (e.g., nuget.org, npmjs.com, other Azure Artifacts feeds) that an Azure Artifacts feed can 'pull' packages from, automatically caching them upon first request.

  • Provides a single point of access for internal and external packages.
  • Automatically caches packages from upstream sources.
  • Supports different prioritization behaviors (e.g., 'Local packages first').

Memory trick: Think of an Artifacts feed as a smart librarian: it can fetch books from other libraries (upstream sources), keep local books prioritized, and cache popular ones for quick access.

More Design and implement source control questions