Install https://github.com/Microsoft/artifacts-credprovider
Add a nuget.config file to your project, in the same folder as your .csproj or .sln file. E.g.:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="{displayName}" value="{url}/index.json" />
</packageSources>
</configuration>
Restore packages (using the interactive flag, which allows dotnet to prompt you for credentials)
dotnet restore --interactive
Note: You don't need --interactive every time. dotnet will prompt you to add --interactive if it needs updated credentials.
- Generate an Azure DevOps PAT
- Add nuget source the usual way in VS