| title | Publish and download NuGet packages with Azure Artifacts |
|---|---|
| description | Learn how to use Azure Artifacts to publish and download NuGet packages. |
| ms.service | azure-devops-artifacts |
| ms.topic | quickstart |
| ms.author | rabououn |
| author | ramiMSFT |
| ms.assetid | C5112218-DA7E-4016-986D-2D0F70DAFA44 |
| ms.date | 06/20/2025 |
| monikerRange | <=azure-devops |
| recommendations | true |
[!INCLUDE version-lt-eq-azure-devops]
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.
| 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. |
::: moniker range="azure-devops"
-
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.
:::image type="content" source="./media/project-setup.png" alt-text="A screenshot displaying how to set up your project and connect to your feed in Azure DevOps Services.":::
::: moniker-end
::: moniker range="=azure-devops-2022"
-
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.
:::image type="content" source="./media/connect-to-feed-nuget-server-2020.png" alt-text="A screenshot displaying how to set up your project and connect to your feed in Azure DevOps Server 2020 and 2022.":::
::: moniker-end
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>
-
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.
To restore packages from your feed, run the following command in your project directory:
nuget.exe restore
::: moniker range="azure-devops"
Note
Searching for packages in upstream sources using the NuGet Package Explorer is not supported.
::: moniker-end