Managing NuGet Packages in Azure Artifacts

This document guides you through the essential operations for managing NuGet packages within your Azure DevOps Artifacts feeds.

Prerequisite: Ensure you have created a NuGet feed in your Azure DevOps project.

Uploading NuGet Packages

You can upload your built NuGet packages to your Azure Artifacts feed using the dotnet nuget push command or directly through the Azure DevOps portal.

Using dotnet CLI:

First, authenticate with your feed:

dotnet nuget add source "https://pkgs.dev.azure.com/{YOUR_ORG}/{YOUR_PROJECT}/_packaging/{YOUR_FEED_NAME}/nuget/v3/index.json" --name "{YOUR_FEED_NAME}" --store-password-in-clear-text

Then, push your package:

dotnet nuget push "path/to/your/package.nupkg" --source "{YOUR_FEED_NAME}" --api-key az

Using Azure DevOps Portal:

  1. Navigate to your Artifacts feed.
  2. Click the Upload button.
  3. Select your .nupkg file(s) and confirm.

Consuming NuGet Packages

To consume packages from your feed in your projects, configure your NuGet client or NuGet.config file.

Using dotnet CLI:

dotnet restore

Ensure your NuGet.config file is set up correctly, for example:

<configuration>
  <packageSources>
    <clear />
    <add key="MyAzureFeed" value="https://pkgs.dev.azure.com/{YOUR_ORG}/{YOUR_PROJECT}/_packaging/{YOUR_FEED_NAME}/nuget/v3/index.json" />
  </packageSources>
</configuration>

Upstream Sources

Upstream sources allow you to consolidate packages from public registries (like NuGet.org) and other Azure Artifacts feeds into a single feed. This simplifies dependency management.

  • Navigate to your feed settings.
  • Select Upstream sources.
  • Click Add upstream source and configure it with the desired service and URL.

Permissions and Access

Manage access to your feeds by configuring permissions for users and groups.

  • Go to your feed settings.
  • Select Permissions.
  • Add or remove users/groups and assign appropriate roles (e.g., Reader, Contributor).

Deleting Packages

You can delete specific versions of a package from your feed. This operation is permanent.

  1. Navigate to your feed and find the package.
  2. Select the version you wish to delete.
  3. Click the ellipsis (...) menu and choose Delete.