@@ -54,8 +54,6 @@ NuGet 4.8.2 and later supports the Azure Artifacts Credential Provider, which au
54
54
55
55
::: moniker-end
56
56
57
- Then, run any [ NuGet command] ( /nuget/tools/nuget-exe-cli-reference ) .
58
-
59
57
::: moniker range="<= tfs-2018 || azure-devops"
60
58
61
59
## Add a feed to NuGet 2
@@ -81,17 +79,23 @@ To use a 2.x client, first get the v3 feed URL:
81
79
> ![ NuGet Package source URL in the Connect to feed dialog] ( ../media/nuget-consume-url-azure-devops-newnav.png )
82
80
>
83
81
84
- Then, at the end of the URL, replace ` /v3/index.json ` with ` /v2 ` .
82
+ Then replace ` /v3/index.json ` with ` /v2 ` .
85
83
86
84
[ !INCLUDE [ generate-pat] ( ../includes/generate-pat.md )]
87
85
88
- Run
86
+ Run the following command in an elevated command prompt window to add a NuGet package source:
89
87
90
88
``` Command
91
- nuget sources add -name {your feed name} -source {your feed URL} -username {anything} -password {your PAT}
89
+ nuget sources add -name < Feed_Name > -source < Feed_URL > -username < Any_String_But_Not_Null > -password < Personal_Access_Token >
92
90
```
93
91
94
- Then, run any [ NuGet command] ( /nuget/tools/nuget-exe-cli-reference ) .
92
+ 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:
93
+
94
+ ``` Command
95
+ nuget sources add -name < Feed_Name> -source < Feed_URL> -username < Azure_Active_Directory_UserName> -password < Azure_Active_Directory_Password>
96
+
97
+ nuget setapikey < Personal_Access_Token> -source < Feed_URL>
98
+ ```
95
99
96
100
::: moniker-end
97
101
@@ -112,7 +116,7 @@ To use a 2.x client, first get the v3 feed URL:
112
116
![ NuGet Package source URL in the Connect to feed dialog] ( ../media/nuget-consume-url.png )
113
117
114
118
115
- Then, replace ` /v3/index.json ` with ` /v2 ` .
119
+ Then replace ` /v3/index.json ` with ` /v2 ` .
116
120
117
121
[ !INCLUDE [ generate-pat] ( ../includes/generate-pat.md )]
118
122
@@ -130,4 +134,4 @@ nuget sources add -name <Feed_Name> -source <Feed_URL> -username <Azure_Active_D
130
134
nuget setapikey < Personal_Access_Token> -source < Feed_URL>
131
135
```
132
136
133
- ::: moniker-end
137
+ ::: moniker-end
0 commit comments