Use dotnet with Team Services feeds

Last Update: 4/25/2017

Availability
NuGet Package Management is available with Visual Studio Team Services and TFS 2017 and newerTFS 2017.

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 Team Services 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