title | description | ms.assetid | ms.technology | ms.topic | ms.date | monikerRange |
---|---|---|---|---|---|---|
Use NuGet with Azure DevOps Services feeds |
Authenticating to feeds with NuGet in Azure DevOps Services |
10665DBC-846E-4192-8CAB-D5A4C6E40C65 |
devops-artifacts |
conceptual |
03/24/2020 |
>= tfs-2018 |
Azure DevOps Services
Note
This page covers interactive scenarios. In Azure Pipelines, use the NuGet step to restore and publish packages.
[!INCLUDE nuget-recommended-version]
NuGet 4.8.2 and later supports the Azure Artifacts Credential Provider, which automatically acquires feed credentials when needed. For more information on using credential providers with NuGet, see Creating a NuGet credential provider.
-
Navigate to your feed (or create a feed if you haven't).
-
Select Connect to feed:
::: moniker range=">= azure-devops-2019"
-
Select NuGet.exe under the NuGet header
-
Select Get the tools in the top-right corner
-
Follow steps 1 and 2 to download the latest NuGet version and the credential provider.
-
Follow the instructions in the Project setup, Restore packages, and Publish packages sections to publish.
[!NOTE] You can also paste the Project setup XML snippet in your default nuget.config file to use outside of a project.
::: moniker-end
::: moniker range="<= tfs-2018"
-
Follow steps 1, 2, and 3 to get the tools, add the feed to your local NuGet configuration, and push the package.
::: moniker-end
Then, run any NuGet command.
::: moniker range="<= tfs-2018 || azure-devops"
::: moniker-end
::: moniker range="azure-devops"
NuGet 2 uses Personal Access Tokens to access feeds.
To use a 2.x client, first get the v3 feed URL:
-
Navigate to your feed (or create a feed if you haven't).
-
Select Connect to feed:
-
Copy the NuGet package source URL:
Then, at the end of the URL, replace /v3/index.json
with /v2
.
[!INCLUDE generate-pat]
Run
nuget sources add -name {your feed name} -source {your feed URL} -username {anything} -password {your PAT}
Then, run any NuGet command.
::: moniker-end
::: moniker range="<= tfs-2018"
NuGet 2 uses Personal Access Tokens to access feeds.
To use a 2.x client, first get the v3 feed URL:
-
Navigate to your feed (or create a feed if you haven't).
-
Select Connect to feed:
-
Copy the NuGet package source URL:
Then, at the end of the URL, replace /v3/index.json
with /v2
.
[!INCLUDE generate-pat]
Run
nuget sources add -name {your feed name} -source {your feed URL} -username {anything} -password {your PAT}
Then, run any NuGet command.
::: moniker-end