Skip to content

Commit 7b1a575

Browse files
authored
Merge branch 'main' into dmwendia-sfi-mscustom
2 parents fbeea09 + da67a3c commit 7b1a575

31 files changed

+2405
-1354
lines changed

docs/artifacts/npm/npm-audit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This synchronization ensures that other projects sharing the same feed will also
3434
npm audit
3535
```
3636

37-
1. If you want to attempt to upgrade to non-vulnerable package versions, make sure you're [connected to your feed](./npmrc.md#connect-to-feed) first, then run the following command in your project directory:
37+
1. If you want to attempt to upgrade to non-vulnerable package versions, make sure you're [connected to your feed](npmrc.md#connect-to-a-feed) first, then run the following command in your project directory:
3838
3939
```Command
4040
npm audit fix

docs/artifacts/npm/npmrc.md

Lines changed: 64 additions & 91 deletions
Large diffs are not rendered by default.

docs/artifacts/npm/publish.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ If this is your first time using Azure Artifacts with npm on your machine, follo
4646
4747
## Publish packages
4848
49-
1. If you haven't authenticated with your feed yet, follow the steps in the [Project setup](npmrc.md#connect-to-feed) to connect to your feed and then proceed with the next step once you're done.
49+
1. If you haven't authenticated with your feed yet, follow the steps in the [Project setup](npmrc.md#connect-to-a-feed) to connect to your feed and then proceed with the next step once you're done.
5050
5151
1. Run the following command in your project directory to publish the npm packages listed in your *package.json*:
5252

docs/artifacts/npm/restore-npm-packages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ If this is your first time using Azure Artifacts with npm on your machine, follo
4343
4444
## Restore packages
4545
46-
1. If you haven't authenticated with your feed yet, follow the steps in the [Project setup](npmrc.md#connect-to-feed) to connect to your feed and then proceed with the next step once you're done.
46+
1. If you haven't authenticated with your feed yet, follow the steps in the [Project setup](npmrc.md#connect-to-a-feed) to connect to your feed and then proceed with the next step once you're done.
4747
4848
1. Run the following command in your project directory to restore all your npm packages:
4949

docs/artifacts/npm/upstream-sources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ If you checked the upstream sources checkbox during the creation of your feed, n
5454

5555
## Install packages from npmjs
5656

57-
Before you save packages from npmjs, make sure your project is set up to connect to your feed. If you haven't done this yet, follow the provided instructions to [set up your npm project](npmrc.md#connect-to-feed) and connect to your feed. In this example, we'll install the *Axios* library for making HTTP requests:
57+
Before you save packages from npmjs, make sure your project is set up to connect to your feed. If you haven't done this yet, follow the provided instructions to [set up your npm project](npmrc.md#connect-to-a-feed) and connect to your feed. In this example, we'll install the *Axios* library for making HTTP requests:
5858

5959
1. Navigate to npmjs at `https://www.npmjs.com//`.
6060

Lines changed: 85 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,129 @@
11
---
22
ms.subservice: azure-devops-ecosystem
33
ms.topic: conceptual
4-
title: Use the Cross-platform CLI for Azure DevOps
5-
description: Use the Cross-platform CLI for Azure DevOps, using personal access tokens (PATs).
4+
title: Cross-platform CLI authentication for Azure DevOps
5+
description: Learn authentication options for the cross-platform CLI for Azure DevOps, including Microsoft Entra ID tokens and personal access tokens.
66
ms.assetid: 6dc7f977-4b62-4bd6-b77a-1c6cade1ffa8
77
monikerRange: '<= azure-devops'
88
ms.author: chcomley
99
author: chcomley
10-
ms.date: 11/10/2023
10+
ms.date: 07/14/2025
1111
---
1212

13-
# Use the Cross-platform CLI for Azure DevOps using personal access tokens
13+
# Cross-platform CLI authentication for Azure DevOps
1414

1515
[!INCLUDE [version-lt-eq-azure-devops](../../../includes/version-lt-eq-azure-devops.md)]
1616

17-
Use personal access tokens (PATs) with the cross-platform CLI for Azure DevOps.
17+
This article explains authentication approaches for the cross-platform CLI (tfx-cli) and Azure DevOps.
1818

1919
> [!IMPORTANT]
20-
> We don't recommend using basic authentication or PATs. Instead, we recommend using [Microsoft Entra-based authentication](../authentication/entra.md), if you're interacting with Microsoft Entra accounts.
20+
> We recommend using [Microsoft Entra ID authentication](../authentication/entra.md) as the primary method for authentication. Personal access tokens (PATs) should be used only when Microsoft Entra ID authentication isn't available. Basic authentication is deprecated and not recommended.
2121
2222
## Prerequisites
2323

24-
- Latest version of [**Node.js source code**](https://nodejs.org/en/download/)
25-
- **Cross-platform CLI for Azure DevOps**
26-
- Install **tfx-cli** using `npm`, a component of Node.js by running:
24+
Before you begin, ensure you have:
2725

28-
```no-highlight
29-
npm i -g tfx-cli
26+
- [Node.js](https://nodejs.org/en/download/) (latest LTS version recommended)
27+
- **tfx-cli** installed globally:
28+
29+
```bash
30+
npm install -g tfx-cli
3031
```
3132

32-
For more information about **tfx-cli**, see the [Node CLI for Azure DevOps on GitHub](https://github.com/Microsoft/tfs-cli).
33+
For more information about tfx-cli, see the [Node CLI for Azure DevOps on GitHub](https://github.com/Microsoft/tfs-cli).
3334

34-
## Personal access token
35+
## Authentication methods
3536

36-
Create a personal access token and paste it into the sign-in command.
37+
Choose the appropriate authentication method based on your environment:
3738

38-
```
39-
~$ tfx login
40-
Copyright Microsoft Corporation
39+
| Method | Recommended for |
40+
|--------|----------------|
41+
| Microsoft Entra ID | Azure DevOps Services |
42+
| PAT | Azure DevOps Server, automation scripts |
43+
| Basic Authentication | Azure DevOps Server only |
4144

42-
> Service URL: {url}
43-
> Personal access token: xxxxxxxxxxxx
44-
Logged in successfully
45+
## Microsoft Entra ID authentication (Recommended)
46+
47+
For Azure DevOps Services, use Microsoft Entra ID authentication for the best security:
48+
49+
```bash
50+
tfx login
4551
```
4652

47-
See the following examples of valid URLs:
53+
When prompted:
54+
1. Enter your service URL, for example, `https://dev.azure.com/Your_Organization`.
55+
2. Follow the browser-based authentication flow.
56+
3. Complete the sign-in process in your browser.
4857

49-
- `https://marketplace.visualstudio.com`
50-
- `https://youraccount.visualstudio.com/DefaultCollection`
58+
For detailed guidance on Microsoft Entra ID authentication, see [Microsoft Entra-based authentication](../authentication/entra.md).
5159

52-
## Configure for Basic authentication
60+
## PAT authentication
5361

54-
> [!WARNING]
55-
> We don't recommend basic authentication. Turning on IIS basic authentication causes various issues, and you should use [personal access tokens (PATs)](../../../organizations/accounts/use-personal-access-tokens-to-authenticate.md) instead. For example, if you turn on IIS basic authentication, GIT command line stops working.
62+
Use PATs when Microsoft Entra ID authentication isn't available, such as with Azure DevOps Server.
5663

57-
Follow these steps to enable basic auth for your Azure DevOps instance:
64+
### Create and use a PAT
5865

59-
> [!WARNING]
60-
> Basic authentication sends usernames and passwords in plaintext. Consider [configuring Azure DevOps Server to use SSL](/azure/devops/server/admin/setup-secure-sockets-layer) to enable secure communication when using basic auth.
66+
1. [Create a PAT](../../../organizations/accounts/use-personal-access-tokens-to-authenticate.md) with the required scopes.
67+
2. Sign in using the PAT:
6168

62-
1. Install the `Basic Authentication` feature for IIS in Server Manager.
69+
```bash
70+
tfx login
71+
```
6372

64-
> [!div class="mx-imgBorder"]
65-
> ![Screenshot of configure basic authentication feature.](./media/configureBasicAuthFeature.png)
73+
3. When prompted, provide:
74+
- **Service URL**: Your Azure DevOps instance URL.
75+
- **Personal access token**: The PAT you created.
6676

67-
2. Open IIS Manager and expand to the `Azure DevOps Server` website, double-click the `Authentication` tile in the Features view.
77+
**Example URLs:**
78+
- Azure DevOps Services: `https://dev.azure.com/Your_Organization`
79+
- Azure DevOps Server: `https://yourserver/tfs/DefaultCollection`
80+
- Visual Studio Marketplace: `https://marketplace.visualstudio.com`
6881

69-
3. Choose `Basic Authentication` in the list of authentication methods. Choose `Enable` in the right hand column. You should now see `Basic Authentication` enabled.
82+
**Example session:**
83+
```
84+
~$ tfx login
85+
Copyright Microsoft Corporation
7086

71-
> [!NOTE]
72-
> Leave the **domain** and **realm** settings for Basic Authentication empty.
87+
> Service URL: https://dev.azure.com/Your_Organization
88+
> Personal access token: **********************
89+
Logged in successfully
90+
```
7391
74-
## tfx sign in with Basic authentication
92+
## Basic authentication (Deprecated)
7593
76-
Now you can start to use `tfx` against your server. Sign in before you issue commands.
94+
> [!WARNING]
95+
> Basic authentication is deprecated and not recommended. Use Microsoft Entra ID instead. Basic authentication:
96+
> - Sends credentials in plaintext
97+
> - Can cause issues with Git command line operations
98+
> - Poses security risks
7799
78-
1. Enter the following command:
100+
### Configure basic authentication (Azure DevOps Server only)
79101
80-
```no-highlight
81-
tfx login --auth-type basic
82-
```
102+
If you must use basic authentication with Azure DevOps Server installations:
83103
84-
2. Add your service url.
85-
3. Add your username. Use `domain\user` (for example, fabrikam\peter). If you're working on a workgroup machine, use `machinename\user`.
86-
4. Add your password. Enter the password for the username that you previously entered.
104+
1. **Enable IIS Basic Authentication:**
105+
- Open Server Manager.
106+
- Install the Basic Authentication feature for IIS.
107+
- In IIS Manager, go to your Azure DevOps Server website.
108+
- Double-select **Authentication** in the Features view.
109+
- Enable Basic Authentication.
110+
- Leave domain and realm settings empty.
87111
88-
**You can now use any other tfx command.**
112+
2. **Sign in with basic authentication:**
89113
90-
```no-highlight
91-
> tfx login --auth-type basic
92-
Copyright Microsoft Corporation
114+
```bash
115+
tfx login --auth-type basic
116+
```
93117
94-
Enter service url > http://localhost:8080/tfs/defaultcollection
95-
Enter username > fabfiber\peter
96-
Enter password > *******
97-
logged in successfully
98-
```
118+
3. When prompted, provide:
119+
- **Service URL**: Your on-premises server URL (for example, `http://yourserver:8080/tfs/DefaultCollection`).
120+
- **Username**: Use `domain\username` format (for example, `fabrikam\john`)
121+
- **Password**: Your domain password.
122+
123+
> [!TIP]
124+
> Consider [configuring SSL](/azure/devops/server/admin/setup-secure-sockets-layer) for secure communication when using basic authentication.
125+
126+
## Next step
127+
128+
> [!div class="nextstepaction"]
129+
> [View the complete tfx-cli command reference](https://github.com/Microsoft/tfs-cli)

0 commit comments

Comments
 (0)