title | description | ms.assetid | ms.technology | ms.topic | ms.date | monikerRange |
---|---|---|---|---|---|---|
Connect to a feed - NuGet.exe |
How to connect to an Azure Artifacts feed |
10665DBC-846E-4192-8CAB-D5A4C6E40C65 |
devops-artifacts |
conceptual |
10/18/2021 |
<= azure-devops |
[!INCLUDE version-lt-eq-azure-devops]
[!INCLUDE nuget-recommended-version]
::: moniker range=">= azure-devops-2019"
-
Select Artifacts and then select your feed.
-
Select Connect to feed.
:::image type="content" source="../media/connect-to-feed-azure-devops-newnav.png" alt-text="Screenshot showing the connect to feed button":::
-
Select NuGet.exe from the left panel.
-
If this is your first time using Azure Artifacts with NuGet.exe, select Get the tools in the top-right corner and follow the instructions to download and install NuGet and Azure Artifacts Credential Provider.
-
Follow the instructions in the Project setup to set up your nuget.config file.
:::image type="content" source="../media/nuget-azure-devops-newnav.png" alt-text="Screenshot showing how to set up your project's config file":::
::: moniker-end
::: moniker range="tfs-2018"
-
Select Build and Release > Packages.
-
Select your feed from the dropdown menu.
-
Select Connect to feed.
:::image type="content" source="../media/connect-to-feed.png" alt-text="Screenshot showing the connect to feed button in TFS":::
-
Follow the highlighted steps to get the tools, add the feed to your local NuGet configuration, and push your package.
:::image type="content" source="../media/nugeturl.png" alt-text="Screenshot showing how to push your package using NuGet.exe in TFS":::
::: moniker-end
Note
Azure Artifacts Credential Provider is supported in NuGet version 4.8.2 or later. See Creating a NuGet credential provider for more information.
::: moniker range="azure-devops"
With NuGet version 2, you must use a Personal Access Tokens to authenticate to your feed. To do so, we must first get the package source URL:
-
Select Artifacts and then select your feed.
-
Select Connect to feed.
:::image type="content" source="../media/connect-to-feed-azure-devops-newnav.png" alt-text="Screenshot showing the connect to feed button":::
-
Select NuGet.exe from the left panel.
-
Copy your package source URL, and then replace
/v3/index.json
with/v2
.:::image type="content" source="../media/nuget-consume-url-azure-devops-newnav.png" alt-text="Screenshot showing the source URL":::
-
Create a Personal Access Token. Scope your PAT to the organization(s) you want to access and to one of the following scopes: Packaging (read), Packaging (read and write), or Packaging (read, write, and manage).
Run the following command in an elevated command prompt window to add your package source:
nuget sources add -name <Feed_Name> -source <Feed_URL> -username <Any_String_But_Not_Null> -password <Personal_Access_Token>
If your organization is connected to Azure Active Directory, you must first authenticate with your AD credentials, and then add your personal access token using the setapikey command:
nuget sources add -name <Feed_Name> -source <Feed_URL> -username <Azure_Active_Directory_UserName> -password <Azure_Active_Directory_Password>
nuget setapikey <Personal_Access_Token> -source <Feed_URL>
::: moniker-end
::: moniker range="tfs-2018"
With NuGet version 2, you must use a Personal Access Tokens to authenticate to your feed. To do so, we must first get the feed URL:
-
Navigate to your feed, and then select Connect to feed.
:::image type="content" source="../media/connect-to-feed.png" alt-text="Screenshot of the connect to feed button in TFS":::
-
Select NuGet and then copy your NuGet package source URL. Replace
/v3/index.json
with/v2
.:::image type="content" source="../media/nuget-consume-url.png" alt-text="Screenshot showing how to get the package source URL":::
-
Create a Personal Access Token. Scope your PAT to the organization(s) you want to access and to one of the following scopes: Packaging (read), Packaging (read and write), or Packaging (read, write, and manage).
Run the following command in an elevated command prompt window to add your package source:
nuget sources add -name <Feed_Name> -source <Feed_URL> -username <Any_String_But_Not_Null> -password <Personal_Access_Token>
If your organization is connected to Azure Active Directory, you must first authenticate with your AD credentials, and then add your personal access token using the setapikey command:
nuget sources add -name <Feed_Name> -source <Feed_URL> -username <Azure_Active_Directory_UserName> -password <Azure_Active_Directory_Password>
nuget setapikey <Personal_Access_Token> -source <Feed_URL>
::: moniker-end