Connect to Azure Artifacts feeds (NuGet.exe)
TFS 2018
Azure Artifacts allows developers to both publish and download NuGet packages from various sources, including feeds and public registries. You can use it to privately share packages with your team or specific users and also make them publicly accessible, allowing you to share them openly with anyone on the internet. This article will guide you through the process of connecting to your Azure Artifacts feed.
Prerequisites
An Azure DevOps organization and a project. Create an organization or a project if you haven't already.
Install the latest NuGet version.
Install Azure Artifacts Credential Provider.
Project setup
Navigate to your project
http://ServerName:8080/tfs/DefaultCollection/<ProjectName>
.Select Build and Release, and then select Packages.
Select your feed from the dropdown menu, and then select Connect to feed.
Select NuGet from the left panel. Make sure you've installed the prerequisites if this is your first time using Azure Artifacts with NuGet.exe, otherwise select Get the tools to download and install them.
Run the command highlighted in step number two (2) to add your feed source URL to your nuget.config file.
Important
Azure Artifacts Credential Provider requires NuGet 4.8.0.5385
or later. Azure Artifacts recommends using NuGet version 5.5.x
or later as it includes crucial bug fixes related to cancellations and timeouts.
Legacy project setup
If you're using an older version of NuGet, follow the instructions below to connect to your feed:
Navigate to your project
http://ServerName:8080/tfs/DefaultCollection/<ProjectName>
.Select Build and Release, and then select Packages.
Select your feed from the dropdown menu, and then select Connect to feed.
Select NuGet, and then copy your source URL. Replace
/v3/index.json
with/v2
.Create a Personal Access Token, and make sure you scope it to the right organization you want to access and select one of the following scopes: Packaging (read), Packaging (read and write), or Packaging (read, write, and manage).
Run the following command in a command prompt window to add your feed source to your nuget.config file:
nuget sources add -name <FEED_NAME> -source <SOURCE_URL> -username <ANY_STRING_BUT_NOT_NULL> -password <YOUR_PERSONAL_ACCESS_TOKEN>
If your organization is connected to Microsoft Entra ID, you must first authenticate with your AD credentials and then add your personal access token using the setapikey command:
nuget sources add -name <FEED_NAME> -source <SOURCE_URL> -username <AZURE_ACTIVE_DIRECTORY_USERNAME> -password <AZURE_ACTIVE_DIRECTORY_PASSWORD> nuget setapikey <YOUR_PERSONAL_ACCESS_TOKEN> -source <SOURCE_URL>