Use dotnet with VSTS feeds


Support for NuGet packages is available with Package Management in VSTS and TFS 2017 and newer.


This page covers interactive scenarios. In Team Build, use the .NET Core step.

To use dotnet with VSTS NuGet feeds, you'll need to specify a Personal Access Token in plain text.

On Windows, NuGet 4 is functionally equivalent to dotnet, and we recommend using that instead.

Add a feed to dotnet

Generate a Personal Access Token (PAT) using the instructions here. Scope your PAT to the account(s) you want to access and to one of the following scopes: Packaging (read), Packaging (read and write), or Packaging (read, write, and manage).

We strongly recommend not checking your PAT into source control; anyone with access to your PAT can interact with VSTS as you.

Then, create or edit a NuGet.config at the solution root, next to the project.json file.

Add your VSTS feed(s) to your solution by running the following command (replacing {values} where applicable):

nuget.exe sources add -name {feed name} -source {feed URL} -username {username} -password {your PAT} -StorePasswordInClearText