Get started with NuGet packages in Azure Artifacts
Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019 | TFS 2018
Azure Artifacts enables developers to publish, and download NuGet packages from different sources such as feeds and public registries. Artifact feeds can be private to share your packages with your team and specific users, or public to share them publicly with anyone on the internet.
In this article, you'll learn:
- How to create a new feed
- How to set up your project and connect to your feed
- How to publish NuGet packages to your feed
- How to download NuGet packages from your feed
Prerequisites
- An Azure DevOps organization. Create an organization, if you don't have one already.
- Install NuGet client tools
Create a feed
You can create two types of feeds: project-scoped and organization-scoped feeds. All public feeds are scoped to their hosting project and they inherit its visibility settings.
Select Artifacts, and then select Create Feed.
Give your feed a Name and choose its visibility (who can view packages in this feed), upstream sources, and scope (project-scoped or organization-scoped) settings.
Select Create when you're done.
Note
By default, the Project Collection Build Service (org-scoped) and the project-level Build Service (project-scoped) are set to Collaborator when you create a new feed.
Azure Artifacts comes pre-installed in TFS 2018. If this is the first time using your feed, you might be asked to assign a license
Go to Build & Release and select Packages.
Select + New feed.
Give your feed a Name, a Description, and set up who can read, who can contribute and if you want to Include external packages.
Select Create when you're done.
Connect to feed
Sign in to your Azure DevOps organization
https://dev.azure.com/<Your_Organization>
and then navigate to your project.Select Artifacts, and then select your feed from the dropdown menu.
Select Connect to feed.
Select NuGet.exe.
If this is the first time using Azure Artifacts with Nuget.exe, select Get the tools and follow the instructions to:
- Install the latest NuGet version.
- Install Azure Artifacts Credential Provider.
Follow the instructions in the Project setup to add a nuget.config file.
Navigate to your project
http://ServerName:8080/tfs/DefaultCollection/<ProjectName>
.Select Build and Release > Packages.
Select your feed from the dropdown menu.
Select Connect to feed.
Select NuGet and follow the instruction to connect to your feed.
Publish NuGet packages
Run the following command in an elevated command prompt window to set up your nuget.config file and publish your NuGet package to your feed. See nuget sources, and nuget push for more details:
nuget sources add -Name <SourceName> -Source <SourceURL> -username <UserName> -password <Pat>
nuget push -Source <SourceName> -ApiKey key <PackagePath>
If you don't have a NuGet package but want to try publishing packages to your feed, you can install the HelloWorld sample package as follows:
nuget install HelloWorld -ExcludeVersion
Download NuGet packages
1. Get the feed's source URL
Navigate to your project, and then select Artifacts then select your feed.
Select Connect to feed.
Select Visual Studio from the left navigation panel.
Copy your feed's Source URL.
Select Build and Release, and then select Packages.
Select your feed from the dropdown menu.
Select Connect to feed.
Copy your feed's Source URL.
2. Set up Visual Studio
In Visual Studio, select Tools, and then Options.
Expand the NuGet Package Manager section, and then select Package Sources.
Enter the feed's Name and the Source URL, and then select the green (+) sign to add a source.
If you enabled upstream sources in your feed, clear the nuget.org check box.
Select OK.
3. Download packages
- In Visual Studio, right-click on your project, and then select Manage NuGet Packages.
- Select Browse, and then select your feed from the Package source drop-down menu.
- Use the search bar to look for packages from your feed.
Note
Searching for packages in upstreams with NuGet Package Explorer is not supported.
Related articles
Feedback
Submit and view feedback for