Skip to content

Commit 77582d1

Browse files
committed
ad authenticate
1 parent 8432af1 commit 77582d1

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

docs/artifacts/nuget/nuget-exe.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ monikerRange: '>= tfs-2018'
1212

1313
**Azure DevOps Services**
1414

15-
> [!NOTE]
16-
> This page covers interactive scenarios. In Azure Pipelines, use the NuGet step to [restore](../../pipelines/packages/nuget-restore.md) and [publish](../../pipelines/artifacts/nuget.md) packages.
17-
1815
[!INCLUDE [nuget-recommended-version](../includes/nuget/nuget-recommended-version.md)]
1916

2017
## Add a feed to NuGet 4.8.2 or later
@@ -115,16 +112,22 @@ To use a 2.x client, first get the v3 feed URL:
115112
![NuGet Package source URL in the Connect to feed dialog](../media/nuget-consume-url.png)
116113

117114

118-
Then, at the end of the URL, replace `/v3/index.json` with `/v2`.
115+
Then, replace `/v3/index.json` with `/v2`.
119116

120117
[!INCLUDE [generate-pat](../includes/generate-pat.md)]
121118

122-
Run
119+
Run the following command in an elevated command prompt window to add a NuGet package source:
123120

124121
```Command
125-
nuget sources add -name {your feed name} -source {your feed URL} -username {anything} -password {your PAT}
122+
nuget sources add -name <Feed_Name> -source <Feed_URL> -username <Any_String_But_Not_Null> -password <Personal_Access_Token>
126123
```
127124

128-
Then, run any [NuGet command](/nuget/tools/nuget-exe-cli-reference).
125+
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:
129126

130-
::: moniker-end
127+
```Command
128+
nuget sources add -name <Feed_Name> -source <Feed_URL> -username <Azure_Active_Directory_UserName> -password <Azure_Active_Directory_Password>
129+
130+
nuget setapikey <Personal_Access_Token> -source <Feed_URL>
131+
```
132+
133+
::: moniker-end

0 commit comments

Comments
 (0)