- Create a new Personal Access Token (PAT). You can follow the documentation here [1] to set this up
- Important: Make sure to set Accounts field to "All accessible (<your account>) accounts
- Go to the feed details page and click the "Connect to Feed" button. It will give you a NuGet add source command.
- Load a solution with a private feed
- Visual Studio should automatically prompt you for credentials
- Provide the username and the PAT as the password
- If Visual Studio does not prompt you for credentials navigate to Tools > Add Custom Tool > NuGet > Sources and enter your username and PAT (as the password)
Notes
- The credentials are not stored under the apiKeys configuration element but rather it is stored under packageSourceCredentials as an encrypted password
References
[1] Using Personal Access Tokens with VSTS, URL: https://docs.microsoft.com/en-us/vsts/accounts/use-personal-access-tokens-to-authenticate?view=vsts
[2] NuGet restore from a secured feed, URL: https://www.xavierdecoster.com/post/2012/12/12/nuget-package-restore-from-a-secured-feed.html
[3] NuGet API Keys, URL: https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file#apikeys
[4] NuGet config file, URL: https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file
[5] Add a private feed to your NuGet configuration (Windows) , URL: https://docs.microsoft.com/en-us/vsts/package/nuget/consume?view=vsts#windows-add-the-feed-to-your-nuget-configuration
[2] NuGet restore from a secured feed, URL: https://www.xavierdecoster.com/post/2012/12/12/nuget-package-restore-from-a-secured-feed.html
[3] NuGet API Keys, URL: https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file#apikeys
[4] NuGet config file, URL: https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file
[5] Add a private feed to your NuGet configuration (Windows) , URL: https://docs.microsoft.com/en-us/vsts/package/nuget/consume?view=vsts#windows-add-the-feed-to-your-nuget-configuration
This comment has been removed by a blog administrator.
ReplyDelete