|
1 | 1 | --- |
2 | 2 | ms.topic: how-to |
3 | | -title: Authenticate to Azure DevOps with Microsoft Entra ID access tokens |
4 | | -description: Use Microsoft Entra authentication to access Azure DevOps Services. |
| 3 | +title: Authenticate to Azure DevOps with Microsoft Entra ID |
| 4 | +description: Use Microsoft Entra ID authentication for secure access to Azure DevOps Services with modern identity management capabilities. |
5 | 5 | ms.assetid: 19285121-1805-4421-B7C4-63784C9A7CFA |
6 | 6 | ms.subservice: azure-devops-security |
| 7 | +ai-usage: ai-assisted |
7 | 8 | monikerRange: 'azure-devops' |
8 | 9 | ms.author: chcomley |
9 | 10 | author: chcomley |
10 | | -ms.date: 01/31/2025 |
| 11 | +ms.date: 07/14/2025 |
11 | 12 | --- |
12 | 13 |
|
13 | | -# Authenticate to Azure DevOps with Microsoft Entra |
| 14 | +# Authenticate to Azure DevOps with Microsoft Entra ID |
14 | 15 |
|
15 | | -[Microsoft Entra ID](/entra/fundamentals/whatis) is an identity and access management (IAM) platform that allows companies to manage organization membership and safeguard company resources. Many Azure DevOps enterprise customers choose to [connect their Azure DevOps organization to a Microsoft Entra ID tenant](../../../organizations/accounts/connect-organization-to-azure-ad.md) to support managing the large volume of users in their company and take advantage of other [security features that Microsoft Entra offers](../../../organizations/accounts/access-with-azure-ad.md). |
| 16 | +[!INCLUDE [version-eq-azure-devops](../../../includes/version-eq-azure-devops.md)] |
| 17 | + |
| 18 | +> [!IMPORTANT] |
| 19 | +> **Microsoft Entra ID authentication is the recommended approach** for new applications integrating with Azure DevOps Services. It provides enhanced security, enterprise identity integration, and modern authentication capabilities. |
| 20 | +
|
| 21 | +This article explains the benefits of Microsoft Entra ID authentication and guides you through implementing it in your applications. |
| 22 | + |
| 23 | +## Overview |
| 24 | + |
| 25 | +[Microsoft Entra ID](/entra/fundamentals/whatis) is Microsoft's cloud-based identity and access management platform that lets organizations: |
| 26 | + |
| 27 | +- **Manage user identities** and control access to resources |
| 28 | +- **Implement enterprise security policies** like multi-factor authentication and Conditional Access |
| 29 | +- **Integrate with thousands of applications** including Azure DevOps Services |
| 30 | +- **Provide single sign-on (SSO)** across Microsoft and non-Microsoft services |
| 31 | + |
| 32 | +Many Azure DevOps enterprise customers [connect their Azure DevOps organization to Microsoft Entra ID](../../../organizations/accounts/connect-organization-to-azure-ad.md) to use these capabilities and [enhanced security features](../../../organizations/accounts/access-with-azure-ad.md). |
16 | 33 |
|
17 | 34 | > [!NOTE] |
18 | | -> Microsoft Entra was once called [Azure Active Directory (Azure AD)](/entra/fundamentals/new-name), so you may still see references to Azure AD across Microsoft products. Active Directory may also be referenced as the on-premises equivalent of Microsoft Entra. |
| 35 | +> Microsoft Entra ID was previously known as [Azure Active Directory (Azure AD)](/entra/fundamentals/new-name). You might still see references in some Microsoft products and documentation. |
| 36 | +
|
| 37 | +## Authentication options |
| 38 | + |
| 39 | +The [Microsoft Identity platform](/entra/identity-platform/) provides two primary authentication patterns for Azure DevOps access: |
| 40 | + |
| 41 | +### User delegation (OAuth) |
| 42 | +**Best for**: Interactive applications that act on behalf of users |
| 43 | + |
| 44 | +- Users sign in with their Microsoft Entra ID credentials |
| 45 | +- Applications receive delegated permissions to act as the signed-in user |
| 46 | +- Supports multi-factor authentication and Conditional Access policies |
| 47 | +- Ideal for web applications, desktop apps, and user-facing tools |
| 48 | + |
| 49 | +**Get started**: [Microsoft Entra ID OAuth implementation](entra-oauth.md) |
| 50 | + |
| 51 | +### Application identity (Service principals and managed identities) |
| 52 | +**Best for**: Background services and automation scenarios |
| 53 | + |
| 54 | +- Applications authenticate using their own identity (not user credentials) |
| 55 | +- Suitable for CI/CD pipelines, background services, and automated tools |
| 56 | +- More secure for service-to-service communication |
| 57 | +- Supports both service principals and Azure managed identities |
| 58 | + |
| 59 | +**Get started**: [Service principals and managed identities](service-principal-managed-identity.md) |
| 60 | + |
| 61 | +## Benefits of Microsoft Entra ID authentication |
19 | 62 |
|
20 | | -Once connected, the [Microsoft Identity application platform](/entra/identity-platform/) that sits on top of Microsoft Entra ID can be used to register an application to access Azure tenants and define the permissions needed from Azure resources, including Azure DevOps. |
| 63 | +Microsoft Entra ID authentication provides significant advantages over legacy Azure DevOps authentication methods: |
21 | 64 |
|
22 | | -We support app development for: |
23 | | -* [Microsoft Entra OAuth apps (on-behalf-of users)](entra-oauth.md) |
24 | | -* [Microsoft Entra service principals and managed identities (on-behalf-of itself apps)](service-principal-managed-identity.md) |
| 65 | +### Enhanced security |
| 66 | +- **Short-lived tokens** (1 hour expiration) reduce risk from compromised credentials |
| 67 | +- **Conditional Access policies** protect against token theft and unauthorized access |
| 68 | +- **Multi-factor authentication** support for other security layers |
| 69 | +- **Advanced threat protection** with real-time risk assessment |
25 | 70 |
|
26 | | -## Azure DevOps-based auth vs. Entra-based auth |
| 71 | +### Enterprise integration |
| 72 | +- **Single sign-on** across Microsoft and non-Microsoft applications |
| 73 | +- **Centralized identity management** for users and applications |
| 74 | +- **Policy enforcement** at the organizational level |
| 75 | +- **Audit and compliance** capabilities for governance requirements |
27 | 76 |
|
28 | | -Many native Azure DevOps-based authentication (for example, [personal access tokens (PATs)](../../../organizations/accounts/use-personal-access-tokens-to-authenticate.md) or Azure DevOps OAuth apps) were created before Microsoft Entra. Microsoft Entra tokens offer a secure alternative, lasting only one hour before requiring a refresh. The authentication protocols for generating Entra tokens are more robust and secure. Security measures like [Conditional Access policies](../../../organizations/accounts/change-application-access-policies.md#cap-support-on-azure-devops) protect against token theft and replay attacks. Meanwhile, our native tokens sit outside Azure and don't have native support for concepts, like tenants or Conditional Access. |
| 77 | +### Developer experience |
| 78 | +- **Modern authentication libraries** (MSAL) with automatic token refresh |
| 79 | +- **Consistent identity platform** across all Microsoft services |
| 80 | +- **Rich documentation and samples** for quick implementation |
| 81 | +- **Active support and development** with regular feature updates |
29 | 82 |
|
30 | | -Tokens issued by each platform are also distinct. Microsoft Entra OAuth apps issue Microsoft Entra tokens, not Azure DevOps access tokens. These tokens can't be used interchangeably on each platform. If you are exploring migrating from Azure DevOps OAuth to Microsoft Entra OAuth, users must reauthorize for the new app. |
| 83 | +### Comparison with legacy methods |
31 | 84 |
|
32 | | -## Replace PATs with Microsoft Entra tokens |
| 85 | +| Feature | Microsoft Entra ID | Personal Access Tokens | Azure DevOps OAuth | |
| 86 | +|---------|-------------------|------------------------|-------------------| |
| 87 | +| **Token lifespan** | 1 hour (auto-refresh) | Up to 1 year | Configurable | |
| 88 | +| **Multi-factor authentication** | ✅ Native support | ❌ Not supported | ❌ Not supported | |
| 89 | +| **Conditional Access** | ✅ Full support | ❌ Not supported | ❌ Not supported | |
| 90 | +| **Enterprise policies** | ✅ Enforced | ⚠️ Limited | ⚠️ Limited | |
| 91 | +| **Audit logging** | ✅ Comprehensive | ⚠️ Basic | ⚠️ Basic | |
| 92 | +| **Future investment** | ✅ Active development | ⚠️ Maintenance mode | ❌ Deprecated | |
33 | 93 |
|
34 | | -Personal access tokens (PATs) are a popular form of Azure DevOps authentication due to their ease of creation and use. However, poor PAT management and storage can result in leaks and unauthorized access to your Azure DevOps organizations. Long-lived or over-scoped PATs increase the risk of damage from a leaked PAT. We encourage users to explore using Microsoft Entra tokens instead of PATs whenever possible. |
| 94 | +> [!IMPORTANT] |
| 95 | +> **Token compatibility**: Microsoft Entra ID tokens and Azure DevOps tokens aren't interchangeable. Applications migrating from Azure DevOps OAuth to Microsoft Entra ID OAuth require user reauthorization. |
35 | 96 |
|
36 | | -### Common PAT alternatives |
| 97 | +### Migration from legacy authentication |
37 | 98 |
|
38 | | -Due to their increasing risk, admins are increasingly requesting [security policies that restrict PAT creation](../../../organizations/accounts/manage-pats-with-policies-for-administrators.md). As a result, PATs are becoming a less viable alternative for accessing Azure DevOps programmatically. Outside of migrating any existing app development to the Microsoft Identity platform, we share some common use cases across Azure DevOps that historically rely on PATs and their recommended Microsoft Entra alternative. |
| 99 | +Organizations increasingly adopt [security policies that restrict Personal Access Token (PAT) creation](../../../organizations/accounts/manage-pats-with-policies-for-administrators.md) due to security risks. Microsoft Entra ID authentication provides secure alternatives for common PAT scenarios. |
39 | 100 |
|
40 | | -| PAT scenario | Entra alternative | |
| 101 | +| PAT scenario | Microsoft Entra alternative | |
41 | 102 | |------------|------------| |
42 | 103 | | Authenticate with Git Credential Manager (GCM) | GCM defaults to authenticating with PATs. Set the default credential type to `oauth`. Learn more on our [Git Credential Manager (GCM) page](../../../repos/git/set-up-credential-managers.md) . | |
43 | 104 | | Authenticate in a build or release pipeline | Use a [service connection with Workload Identity Federation](../../../pipelines/library/connect-to-azure.md#create-an-azure-resource-manager-service-connection-that-uses-workload-identity-federation). | |
|
0 commit comments