Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Azure DevOps Services | Azure DevOps Server 2022 | Azure DevOps Server 2020
Azure Artifacts enables developers to publish and download NuGet packages from feeds or public registries. Feeds can be either private, allowing you to share packages with specific users, or public, making your packages accessible to anyone on the internet.
This article guides you through creating a feed, configuring your project, and publishing and downloading NuGet packages.
Prerequisites
Product | Requirements |
---|---|
Azure DevOps | - An Azure DevOps organization. - An Azure DevOps project. - Download and install the Azure Artifacts Credential Provider. - Install the latest NuGet version. |
Create a feed
Sign in to your Azure DevOps organization and navigate to your project.
Select Artifacts, and then select Create Feed.
Provide a Name for your feed, choose the Visibility option that defines who can view your packages, check Include packages from common public sources if you want to include packages from sources like nuget.org or npmjs.com, and for Scope, decide whether the feed should be scoped to your project or the entire organization.
Select Create when you're done.
Sign in to your Azure DevOps server, and then go to your project.
Select Artifacts, and then select Create Feed.
Provide a Name for your feed, choose the Visibility option that defines who can view your packages, check Include packages from common public sources if you want to include packages from sources like nuget.org or npmjs.com, and for Scope, decide whether the feed should be scoped to your project or the entire organization.
Select Create when you're done.
Select Create when you're done.
Note
By default, the Build Service for the project (for example: projectName Build Service (orgName)) is assigned the Feed and Upstream Reader (Collaborator) role when a new feed is created.
Connect to a feed
Sign in to your Azure DevOps organization, and then go to your project.
Select Artifacts, and then select your feed from the dropdown menu.
Select Connect to Feed, and then select NuGet.exe from the left navigation pane. If this is your first time using Azure Artifacts with Nuget.exe, make sure you've installed the prerequisites.
Follow the provided instructions under the Project setup section to set up your nuget.config file and connect to your Azure Artifacts feed.
Sign in to your Azure DevOps server, and then go to your project.
Select Artifacts, and then select your feed from the dropdown menu.
Select Connect to Feed, and then select NuGet.exe from the left navigation pane.
Follow the provided instructions under the Project setup section to set up your nuget.config file and connect to your Azure Artifacts feed.
Publish packages to your feed
To publish a package to your feed, run the following command. The ApiKey
parameter is required, but you can use any arbitrary string as its value.
nuget.exe push -Source <SOURCE_NAME> -ApiKey key <PACKAGE_PATH>
Examples
Project-scoped feed:
nuget.exe push -Source https://pkgs.dev.azure.com/myOrganization/MyProject/_packaging/MyFeed/nuget/v3/index.json -ApiKey AZ release/myDemoPackage.1.0.0.nupkg
Organization-scoped feed:
nuget.exe push -Source https://pkgs.dev.azure.com/myOrganization/_packaging/myFeed/nuget/v3/index.json -ApiKey AZ release/myDemoPackage.1.0.0.nupkg
Note
The ApiKey
is required, but you can use any arbitrary value when publishing to Azure Artifacts feeds.
Download packages from your feed
To restore packages from your feed, run the following command in your project directory:
nuget.exe restore
Note
Searching for packages in upstream sources using the NuGet Package Explorer is not supported.