0

I use paket as a dependency management tool and am just starting to use Visual Studio online (VSO) to host the source and do the building.

When I do a paket restore (or try to upload a nupkg) I get a 401. VSTS uses a credential manager which seems to generate a unique password each time it's run. I suppose I could write a powershell script to execute the credential manager.exe and pull out the password/username then set it for Paket before doing a restore but ideally I'd like to create a specific user (and password) for the feed only, or generate an api key. Does anyone know if this is possible?

Community
  • 1
  • 1
Dylan
  • 1,306
  • 1
  • 11
  • 29

1 Answers1

2

Paket supports provide username and password in paket.dependencies file, so you can create a personal access token with packaging scope (e.g. Packaging (read and write)), then specify it in paket.dependencies file, for example:

source [your feed url] username: "[anything, such as test]" password: "[personal access token]"

nuget [library]

More information: plaintext-credentials

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53
  • For push specifically, you'll need to supply an API key in addition to the username and password, but it can be any arbitrary value. (We enforce this in order to avoid a CSRF vulnerability) – Jonathan Myers Aug 18 '17 at 13:16
  • Thanks. I had to a little more wrangling with FAKE but this works nicely when pushing Paket.Push(fun c -> {c with PublishUrl = "https://{repo}.pkgs.visualstudio.com/_packaging/{feed}/nuget/v2" WorkingDir = "dist" ApiKey = "someKey" } ) – Dylan Aug 19 '17 at 05:28