Use NuGet or dotnet with Team Foundation Server feeds

TFS 2018 | TFS 2017

Authentication from command-line clients like nuget and dotnet is a little different for Team Foundation Server users.

Domain users on domain-joined machines

You can use consume packages with Visual Studio, publish with nuget, and use nuget and dotnet. Ignore any content about the Credential Provider or Personal Access Tokens—everything will work using your domain credentials.

Non-domain users (e.g. service accounts, users on non-domain-joined machines)

This workflow is not recommended, because it requires that you store your encrypted domain password on disk. Please consider the security implications before continuing.

  1. Navigate to your feed (or create a feed if you haven't).

  2. Select Connect to feed:

    Connect to feed button in the upper-right of the page

  3. Copy the NuGet package source URL:

    NuGet Package source URL in the Connect to feed dialog

Then, run the following command (replacing {values} where applicable):

nuget sources add -name {your feed name} -source {your feed URL} -username {your domain username} -password {your domain password}