Skip to content

Latest commit

 

History

History
130 lines (79 loc) · 4.75 KB

get-started-nuget.md

File metadata and controls

130 lines (79 loc) · 4.75 KB
title description ms.service ms.topic ms.author author ms.assetid ms.date monikerRange recommendations
Quickstart: Get started with NuGet packages and Azure Artifacts
Learn how to use Azure Artifacts to publish and download NuGet packages from your feed.
azure-devops-artifacts
quickstart
rabououn
ramiMSFT
C5112218-DA7E-4016-986D-2D0F70DAFA44
05/14/2024
<= azure-devops
true

Quickstart: Get started with NuGet packages in Azure Artifacts

[!INCLUDE version-lt-eq-azure-devops]

Azure Artifacts enables developers to publish and download NuGet packages from sources such as feeds and public registries. With Azure Artifacts, you can create feeds that are either:

  • Private, so you can share packages with your team and specific users.
  • Public, so you can share packages openly with anyone on the internet.

In this quickstart, you learn how to:

[!div class="checklist"]

  • Create a new feed.
  • Set up your project and connect to your feed.
  • Publish NuGet packages.
  • Download packages from your feed.

Prerequisites

Create a feed

[!INCLUDE ]

Connect to a feed

::: moniker range="azure-devops"

  1. Sign in to your Azure DevOps organization, and then go to your project.

  2. Select Artifacts, and then select your feed from the dropdown menu.

  3. Select Connect to Feed, and then select NuGet.exe from the left pane. If this is your first time using Azure Artifacts with Nuget.exe, ensure that you installed all the prerequisites.

    :::image type="content" source="./media/connect-to-feed-azure-devops-newnav.png" alt-text="Screenshot that shows the button for connecting to a feed.":::

  4. Follow the instructions in the Project setup section to configure your nuget.config file and authenticate with Azure Artifacts.

    :::image type="content" source="./media/project-setup.png" alt-text="Screenshot that shows onscreen instructions for setting up a project.":::

::: moniker-end

::: moniker range="azure-devops-2020 || azure-devops-2022"

  1. Sign in to your Azure DevOps server, and then go to your project.

  2. Select Artifacts, and then select your feed from the dropdown menu.

  3. Select Connect to Feed, and then select NuGet.exe from the left pane.

  4. Follow the instructions in the Project setup section to connect to your feed.

    :::image type="content" source="./media/connect-to-feed-nuget-server-2020.png" alt-text="Screenshot that shows onscreen instructions for setting up a NuGet project in Azure DevOps Server 2020 and 2022.":::

::: moniker-end

::: moniker range="azure-devops-2019"

  1. Sign in to your Azure DevOps server, and then go to your project.

  2. Select Artifacts, and then select your feed from the dropdown menu.

  3. Select Connect to Feed, and then select NuGet from the left pane.

  4. Follow the instructions to add your package source URL to nuget.config.

    :::image type="content" source="./media/connect-to-feed-nuget-server-2019.png" alt-text="Screenshot that shows onscreen instructions for setting up a NuGet project in Azure DevOps Server 2019.":::

::: moniker-end

Download packages

[!INCLUDE ]

::: moniker range="azure-devops"

Note

Using NuGet Package Explorer to search for packages in upstream sources is not supported.

::: moniker-end

Publish packages

To publish your package to your feed, run the following command. You can enter any string for the ApiKey argument.

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.

Related content