Publish a NuGet package using the command line

Azure DevOps Services | Azure DevOps Server 2020 | Azure DevOps Server 2019 | TFS 2018 - TFS 2017

With Azure Artifacts, you can publish your NuGet packages to public or private feeds, and then share them with others depending on your feed's visibility settings.

Connect to a NuGet feed

  1. From within your project, select Artifacts, and then select your feed. You can create a new feed if you don't have one already.

  2. Select Connect to feed.

    Connect to your feed

  3. Select NuGet.exe under the NuGet header.

    NuGet.exe feed connection

  4. If this is the first time using Azure Artifacts with Nuget.exe, select Get the tools button and follow the instructions to install the prerequisites.

    1. Download the latest NuGet version.
    2. Download and install the Azure Artifacts Credential Provider.
  5. Follow the instructions in the Project setup to connect to your feed.

    Project setup

Publish a NuGet package by using the command line

If you don't have a NuGet package but you want to try publishing your package to your feed, you can install the HelloWorld sample package.

nuget install HelloWorld -ExcludeVersion

Run the following command to publish your package to your feed:

nuget.exe push -Source "<YOUR_FEED_NAME>" -ApiKey <ANY_STRING> <PACKAGE_PATH>
  1. Select Build and Release > Packages.

  2. Select your feed from the dropdown menu or create one if you haven't.

  3. Select Connect to feed.

    Connect to feed - TFS

  4. Select NuGet and follow the instruction to connect to your feed.

    Connect to NuGet feed - TFS