IntermediateLesson 8 of 16

Azure Artifacts

Use Azure Artifacts to host internal packages, proxy public registries, control package promotion, and connect package publishing into your CI pipelines.

🧒 Simple Explanation (ELI5)

Imagine your team runs a company warehouse for reusable building parts. Instead of every developer downloading random screws from the internet every day, the company stocks approved parts in one place. Azure Artifacts is that warehouse for software packages.

Your builds can publish what they create, other apps can safely reuse it, and the platform team can decide which package versions are trusted enough for real environments.

🔧 Technical Explanation

What Azure Artifacts Stores

Feed Concepts

ConceptMeaningWhy It Matters
FeedLogical package registrySeparates teams, apps, or trust boundaries
ViewPromotion layer like local, prerelease, releaseControls which versions consumers can see
Upstream sourceProxy to a public registryImproves reliability and centralizes control
RetentionAutomatic cleanup rulesPrevents storage sprawl
PermissionsRead, contribute, manage rightsProtects package publishing and consumption
Package Lifecycle
Build Pipeline
Feed @local
@prerelease
@release

Azure Artifacts vs Pipeline Artifacts

These names sound similar, but they solve different problems:

TypeUse CaseLifetime
Pipeline ArtifactPass build output to another job or stageShort-term build/run scope
Azure Artifacts packagePublish versioned dependency for reuse by other projectsLong-term package registry

🛠️ Hands-on

Publish an npm Package to Azure Artifacts

yaml
steps:
- task: npmAuthenticate@0
  inputs:
    workingFile: .npmrc

- script: |
    npm ci
    npm version 1.4.$(Build.BuildId) --no-git-tag-version
    npm publish
  displayName: 'Publish package'

Publish a Universal Package

yaml
- task: UniversalPackages@0
  inputs:
    command: publish
    publishDirectory: 'drop'
    feedsToUsePublish: internal
    vstsFeedPublish: 'platform-tools'
    vstsFeedPackagePublish: 'webapp-drop'
    versionOption: custom
    versionPublish: '1.0.$(Build.BuildId)'

Use a Feed as an Upstream Cache

Configure the feed to proxy public registries. Then developers and build agents install packages through Azure Artifacts instead of the public internet directly. Benefits include faster dependency restore, tighter auditability, and reduced build breakage during registry outages.

💡
Practical Pattern

For enterprise CI/CD, treat Azure Artifacts as both a distribution point for your internal packages and a controlled entry point for external dependencies.

Where It Fits in Real Delivery

Artifacts often support the build side of the same application that later becomes a Docker image and deploys to AKS. Example: a shared .NET library is published to Azure Artifacts, the application restores that library during CI, then the built service image is pushed to ACR and deployed with Helm. Different registry, same delivery chain.

🐛 Debugging Scenarios

Scenario 1: Authentication to Feed Fails

Scenario 2: Package Restore Works Locally but Fails in CI

Scenario 3: Wrong Package Version Published

⚠️
Versioning Discipline

Package registries are not a scratchpad. Once consumers depend on a version, changing the meaning of that version creates extremely hard-to-debug failures downstream.

📋 Interview Questions

Beginner

What is Azure Artifacts?

It is Azure DevOps package management service for hosting internal and proxied packages such as NuGet, npm, Maven, Python, and universal packages.

What is a feed?

A feed is a logical package registry where packages are stored, versioned, permissioned, and optionally promoted through views.

How is Azure Artifacts different from Azure Container Registry?

Azure Artifacts stores software packages such as npm or NuGet. ACR stores OCI container images used for container deployments.

What is an upstream source?

It is a configured proxy to a public package registry that lets your feed cache and serve packages through Azure Artifacts.

Why use feed views?

They separate freshly published packages from vetted packages so consumers can depend only on versions that have passed quality checks.

Intermediate

How would you organize feeds in a large company?

I would organize feeds around trust and ownership boundaries, not around every tiny repo, and use views to handle promotion instead of creating too many fragmented feeds.

When would you publish a package instead of a pipeline artifact?

When the output is intended for reuse as a dependency across projects or over time. Pipeline artifacts are better for short-lived build-to-deploy handoffs inside one pipeline flow.

What are common governance controls for package feeds?

Restrictive publish permissions, retention rules, upstream control, version immutability, vulnerability scanning, and review before promotion to trusted views.

Why do package caches improve CI reliability?

They reduce dependency on public registry availability and keep builds more deterministic by serving previously retrieved packages locally.

How do you connect package publishing to release quality?

I publish first to a local or prerelease view, then promote only after tests and validation succeed, so consumers pull from controlled quality levels.

Scenario-Based

Your build breaks because npmjs.org is slow. How does Azure Artifacts help?

By using upstream sources, Azure Artifacts can cache external dependencies internally so future builds restore from the feed instead of hitting the public registry every time.

A bad package version was published and multiple services consume it. What is your response?

I stop further promotion, identify impacted consumers, publish a fixed version, and update dependency constraints. I avoid mutating the broken version because that destroys traceability.

How would you explain the relationship between Artifacts and AKS deployment to an interviewer?

Artifacts typically serve the build dependency layer, while ACR and Helm handle container delivery. The pipeline may consume packages from Azure Artifacts, build an app, package it into a container, push to ACR, then deploy to AKS.

What if a pipeline can publish but developers cannot download a package?

I would inspect feed permissions, view visibility, and authentication config on developer machines. Often the package is published to a restricted view or the consumer is pointing at the wrong feed URL.

Would you create one feed per team automatically?

No. I would first check ownership, package sharing patterns, and governance needs. Too many feeds increase complexity and duplicate the same controls everywhere.

🌍 Real-World Usage

In real enterprise delivery, Azure Artifacts supports internal dependency management while pipelines build deployable services. A platform team may publish shared libraries, install them during CI, produce a container, push to ACR, and then deploy the service to AKS with Helm. That separation keeps dependency reuse and runtime deployment concerns clean.

🧾 Summary

Azure Artifacts is the package warehouse for Azure DevOps. It helps teams publish, consume, cache, govern, and promote packages reliably. Used well, it improves build repeatability and fits neatly into larger CI/CD flows without duplicating what ACR and Helm already handle.