You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Personal Access Token (PAT):** Sign in with a [Personal Access Token (PAT)](../organizations/accounts/use-personal-access-tokens-to-authenticate.md#creating-pats) with the following scopes:
32
+
-**Personal Access Token (PAT):** Sign in with a [Personal Access Token (PAT)](../organizations/accounts/use-personal-access-tokens-to-authenticate.md#create-pats) with the following scopes:
This article describes authentication methods for Azure DevOps integration and helps you choose the best option for your scenario. Modern authentication approaches like Microsoft Entra ID provide enhanced security and provide the best approach for new applications.
20
+
This article describes authentication methods for Azure DevOps integration and helps you choose the best option for your scenario. Modern authentication approaches like Microsoft Entra ID provide enhanced security and the best approach for new applications.
21
21
22
22
> [!IMPORTANT]
23
-
> Microsoft Entra ID authentication is recommended for new applications integrating with Azure DevOps Services.
24
-
> Use personal access tokens sparingly, and only use them when Microsoft Entra ID isn't available.
23
+
> We recommend Microsoft Entra ID authentication for new applications that integrate with Azure DevOps Services.
24
+
> Use personal access tokens sparingly, and use them only when Microsoft Entra ID isn't available.
25
25
26
26
OAuth 2.0 and Microsoft Entra ID authentication are available for Azure DevOps Services only, not Azure DevOps Server.
27
27
28
28
For on-premises scenarios, use [.NET client libraries](../../concepts/dotnet-client-libraries.md), Windows authentication, or [personal access tokens](../../../organizations/accounts/use-personal-access-tokens-to-authenticate.md).
29
29
30
30
## Authentication methods by scenario
31
31
32
-
Choose the appropriate authentication method based on your application type and requirements:
32
+
Choose the appropriate authentication method based on your application type and requirements.
33
33
34
34
| Application type | Description | Example | Recommended method | Code samples |
|**Azure DevOps extensions**| Extensions running within Azure DevOps | Custom dashboard widgets and work item forms |[Azure DevOps web extension SDK](https://github.com/Microsoft/azure-devops-extension-sdk)|[Add a dashboard widget](../../../extend/develop/add-dashboard-widget.md)|
41
-
|**Azure DevOps Server apps**| On-premises Azure DevOps Server integrations | Custom server extensions |[.NET client libraries](../../concepts/dotnet-client-libraries.md) or Windows Auth |[Client library console app](https://github.com/Microsoft/vsts-auth-samples/tree/master/ClientLibraryConsoleAppSample)|
42
-
|**Personal/ad-hoc scripts**| Quick scripts for personal use | PowerShell scripts, curl commands |[Personal access tokens](../../../organizations/accounts/use-personal-access-tokens-to-authenticate.md)|[Get started with the REST APIs](../../how-to/call-rest-api.md)|
36
+
| Web/desktop apps | Interactive applications using current frameworks | React app, .NET desktop app |[Microsoft Entra OAuth](./entra-oauth.md) with the Microsoft Authentication Library (MSAL) |[Managed client console app](https://github.com/microsoft/azure-devops-auth-samples/tree/master/ManagedClientConsoleAppSample)|
37
+
| Service/background apps | Applications running without user interaction | Azure Functions, background services |[Service principals and managed identities](./service-principal-managed-identity.md)|[Service principals](https://github.com/microsoft/azure-devops-auth-samples/tree/master/ServicePrincipalsSamples)|
38
+
| Legacy client apps | Existing applications using client libraries | Console apps with Azure DevOps .NET libraries |[.NET client libraries](../../concepts/dotnet-client-libraries.md) with OAuth |[Client library console app](https://github.com/Microsoft/vsts-auth-samples/tree/master/ClientLibraryConsoleAppSample)|
| Azure DevOps extensions | Extensions running within Azure DevOps | Custom dashboard widgets and work item forms |[Azure DevOps web extension SDK](https://github.com/Microsoft/azure-devops-extension-sdk)|[Add a dashboard widget](../../../extend/develop/add-dashboard-widget.md)|
41
+
| Azure DevOps Server apps | On-premises Azure DevOps Server integrations | Custom server extensions |[.NET client libraries](../../concepts/dotnet-client-libraries.md) or Windows Auth |[Client library console app](https://github.com/Microsoft/vsts-auth-samples/tree/master/ClientLibraryConsoleAppSample)|
42
+
| Personal/adhoc scripts | Quick scripts for personal use | PowerShell scripts, curl commands |[Personal access tokens](../../../organizations/accounts/use-personal-access-tokens-to-authenticate.md)|[Get started with the REST APIs](../../how-to/call-rest-api.md)|
43
43
44
44
## Suggestions for getting started
45
45
@@ -60,64 +60,64 @@ The following sections provide recommendations for getting started in different
60
60
### Azure DevOps Server
61
61
62
62
- Use [.NET client libraries](../../concepts/dotnet-client-libraries.md) with Windows Authentication when possible.
63
-
-Personal access tokens are acceptable for some Azure DevOps Server scenarios.
63
+
-Use personal access tokens for Azure DevOps Server scenarios when they're acceptable.
64
64
- Plan for future Azure DevOps Services migration to take advantage of modern authentication.
65
65
66
-
## Answers to common questions
66
+
## Answers to common questions
67
67
68
68
The following sections provide answers to frequently asked questions.
69
69
70
70
### Should I use Microsoft Entra ID OAuth or personal access tokens?
71
71
72
-
**Use Microsoft Entra ID OAuth** in the following scenarios:
72
+
Use Microsoft Entra ID OAuth in the following scenarios:
73
73
74
74
- New applications and integrations
75
75
- Production workloads that require robust security
76
76
- Applications that need enterprise identity integration
77
77
- Long-term projects with compliance requirements
78
78
79
-
**Only use Personal Access Tokens** in the following scenarios:
79
+
Only use personal access tokens in the following scenarios:
80
80
81
-
- Personal scripts and ad-hoc tasks
81
+
- Personal scripts and adhoc tasks
82
82
- Legacy applications during migration planning
83
83
- Azure DevOps Server scenarios where modern authentication isn't available
84
84
85
85
### Should I use service principals or user delegation for authentication?
86
86
87
-
**Use service principals or managed identities** in the following scenarios:
87
+
Use service principals or managed identities in the following scenarios:
88
88
89
-
- Build applications that operate independently (background services, automation)
90
-
- Create apps that don't require user interaction
91
-
- Implement service-to-service communication
92
-
- Build CI/CD pipelines or automated workflows
89
+
- Build applications that operate independently (background services, automation).
90
+
- Create apps that don't require user interaction.
91
+
- Implement service-to-service communication.
92
+
- Build continuous integration and continuous delivery (CI/CD) pipelines or automated workflows.
93
93
94
-
**Use user delegation (OAuth with user consent)** in the following scenarios:
94
+
Use user delegation (OAuth with user consent) in the following scenarios:
95
95
96
-
- Build applications that act on behalf of human users
97
-
- Create interactive apps where users sign in with their own credentials
98
-
- Implement features that require user-specific permissions
99
-
- Build apps that respect user's individual access rights
96
+
- Build applications that act for human users.
97
+
- Create interactive apps where users sign in with their own credentials.
98
+
- Implement features that require user-specific permissions.
99
+
- Build apps that respect users' individual access rights.
100
100
101
-
### How do I authenticate with both Azure DevOps Server and Azure DevOps Services?
101
+
### How do I authenticate with both Azure DevOps Services and Azure DevOps Server?
102
102
103
103
The best practice is to create separate authentication paths:
104
104
105
105
-**Azure DevOps Services**: Use Microsoft Entra ID OAuth.
106
106
-**Azure DevOps Server**: Use .NET client libraries with Windows Authentication or personal access tokens.
107
107
108
-
Use the `requestContext` method to detect the service type and apply the appropriate authentication method.
108
+
Use the `requestContext` method to detect the service type, and apply the appropriate authentication method.
109
109
110
110
### Why can't my service account access Azure DevOps APIs?
111
-
111
+
112
112
Here are some common issues that can affect service account access:
113
113
114
-
-**Service account not "materialized"**: Use correct signin method. Service accounts need interactive sign-in permissions or proper Microsoft Entra ID registration.
115
-
-**Insufficient permissions**: Ensure the service account has appropriate Azure DevOps permissions.
114
+
-**Service account not "materialized"**: Use the correct sign-in method. Service accounts need interactive sign-in permissions or proper Microsoft Entra ID registration.
115
+
-**Insufficient permissions**: Ensure that the service account has appropriate Azure DevOps permissions.
116
116
-**Authentication method**: Use service principals or managed identities instead of trying to authenticate as a service account.
117
117
118
118
### How do I migrate from personal access tokens to modern authentication?
119
119
120
-
Complete the following steps:
120
+
Follow these steps:
121
121
122
122
1. Identify current personal access token usage in your applications.
123
123
@@ -134,17 +134,15 @@ Complete the following steps:
134
134
135
135
## Implementation procedures
136
136
137
-
After you choose the authentication method for your scenario, complete the implementation:
137
+
After you choose the authentication method for your scenario, finish the implementation:
138
138
139
139
-**New applications**: [Build Azure DevOps integrations with Microsoft Entra OAuth apps](entra-oauth.md)
140
-
141
140
-**Service applications**: [Use service principals and managed identities in Azure DevOps](service-principal-managed-identity.md)
142
-
143
141
-**Personal scripts**: [Use personal access tokens](../../../organizations/accounts/use-personal-access-tokens-to-authenticate.md)
144
142
145
143
## Related content
146
144
147
145
-[OAuth 2.0 for Azure DevOps](oauth.md)
148
146
-[Azure DevOps Services REST API reference](/rest/api/azure/devops)
149
147
-[Security and identity in Azure DevOps](../../../organizations/security/about-security-identity.md)
150
-
-[Azure DevOps data protection overview](../../../organizations/security/data-protection.md)
148
+
-[Azure DevOps data protection overview](../../../organizations/security/data-protection.md)
0 commit comments