NuGet.org upstream source

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019 | TFS 2018

Enabling upstream sources on your feed enables developers to consume packages from public registries such as nuget.org and npmjs.com. In this article, you will learn how to add the NuGet Gallery upstream source to consume NuGet packages from the nuget.org public registry.

  1. Select Artifacts, and then select your feed.

  2. Select the gear icon gear icon button to navigate to Feed settings.

  3. Select Upstream Sources, and then select Add Upstream.

    A screenshot showing how to add an upstream source.

  4. Select Public source.

    Screenshot showing how to add a new upstream source.

  5. Select NuGet Gallery from the dropdown menu. Select Save when you are done.

    Screenshot showing how to add the nuget.org upstream source.

    Note

    The service index location for nuget.org is https://api.nuget.org/v3/index.json.

  6. Select Save at the top right corner to save your changes.

Update nuget.config

  1. Select Artifacts, and then select your feed.

  2. Select Connect to feed, and then select NuGet.exe.

    A screenshot showing how to connect to NuGet feeds.

  3. Copy the XML snippet in the Project Setup section.

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <packageSources>
        <clear />
        <add key="<FEED_NAME>" value="https://pkgs.dev.azure.com/<ORGANIZATION_NAME>/_packaging/<FEED_NAME>/nuget/v3/index.json" />
      </packageSources>
    </configuration>
    
  4. Create a new nuget.config file in the root of your project.

  5. Paste the XML snippet in your nuget.config file.

View saved packages

You can view the packages you saved from the NuGet Gallery by selecting your Source from the dropdown menu.

A screenshot showing how to filter packages by source.

A screenshot showing how to filter packages by source in TFS