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
Copy file name to clipboardExpand all lines: docs/connect/ado-net/sql/azure-active-directory-authentication.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Describes how to use supported Microsoft Entra authentication modes
4
4
author: David-Engel
5
5
ms.author: davidengel
6
6
ms.reviewer: davidengel
7
-
ms.date: 06/09/2025
7
+
ms.date: 01/16/2026
8
8
ms.service: sql
9
9
ms.subservice: connectivity
10
10
ms.topic: integration
@@ -28,7 +28,7 @@ Microsoft Entra authentication uses identities in Microsoft Entra ID to access d
28
28
29
29
When you set the `Authentication` connection property in the connection string, the client can choose a preferred Microsoft Entra authentication mode according to the value provided:
30
30
31
-
- The earliest **Microsoft.Data.SqlClient** version supports `Active Directory Password` for .NET Framework, .NET Core, and .NET Standard. It also supports `Active Directory Integrated` authentication and `Active Directory Interactive` authentication for .NET Framework.
31
+
- The earliest **Microsoft.Data.SqlClient** version supports `Active Directory Password`[DEPRECATED]for .NET Framework, .NET Core, and .NET Standard. It also supports `Active Directory Integrated` authentication and `Active Directory Interactive` authentication for .NET Framework.
32
32
- Starting with **Microsoft.Data.SqlClient** 2.0.0, support for `Active Directory Integrated` authentication and `Active Directory Interactive` authentication is extended across .NET Framework, .NET Core, and .NET Standard.
33
33
34
34
A new `Active Directory Service Principal` authentication mode is also added in SqlClient 2.0.0. It makes use of the client ID and secret of a service principal identity to accomplish authentication.
@@ -44,19 +44,21 @@ When the application is connecting to Azure SQL data sources by using Microsoft
44
44
45
45
| Value | Description | Microsoft.Data.SqlClient version |
46
46
|:--|:--|:--:|
47
-
| Active Directory Password | Authenticate with a Microsoft Entra identity's username and password | 1.0+ |
48
47
| Active Directory Integrated | Authenticate with a Microsoft Entra identity by using Integrated Windows Authentication (IWA) | 2.0.0+<sup>1</sup> |
49
48
| Active Directory Interactive | Authenticate with a Microsoft Entra identity by using interactive authentication | 2.0.0+<sup>1</sup> |
50
49
| Active Directory Service Principal | Authenticate with a Microsoft Entra service principal, using its client ID and secret | 2.0.0+ |
51
50
| Active Directory Device Code Flow | Authenticate with a Microsoft Entra identity by using Device Code Flow mode | 2.1.0+ |
52
51
| Active Directory Managed Identity, <br>Active Directory MSI | Authenticate using a Microsoft Entra system-assigned or user-assigned managed identity | 2.1.0+ |
53
52
| Active Directory Default | Authenticate with a Microsoft Entra identity by using password-less and non-interactive mechanisms including managed identities, Visual Studio Code, Visual Studio, Azure CLI, etc. | 3.0.0+ |
54
53
| Active Directory Workload Identity | Authenticate with a Microsoft Entra identity by using a federated User Assigned Managed Identity to connect to SQL Database from Azure client environments that are enabled for Workload Identity. | 5.2.0+ |
54
+
| Active Directory Password [DEPRECATED]| Authenticate with a Microsoft Entra identity's username and password.<br/><br/>Active Directory Password is deprecated. For more information, see [Using password authentication](#using-password-authentication). | 1.0+ |
55
55
56
56
<sup>1</sup> Before **Microsoft.Data.SqlClient** 2.0.0, `Active Directory Integrated`, and `Active Directory Interactive` authentication modes are supported only on .NET Framework.
`Active Directory Password` authentication mode supports authentication to Azure data sources with Microsoft Entra ID for native or federated Microsoft Entra users. When you're using this mode, user credentials must be provided in the connection string. The following example shows how to use `Active Directory Password` authentication.
61
63
62
64
```csharp
@@ -332,7 +334,7 @@ The following example displays how to use a custom callback when `Active Directo
With a customized `ActiveDirectoryAuthenticationProvider` class, a user-defined application client ID can be passed to SqlClient when a supported Microsoft Entra authentication mode is in use. Supported Microsoft Entra authentication modes include `Active Directory Password`, `Active Directory Integrated`, `Active Directory Interactive`, `Active Directory Service Principal`, and `Active Directory Device Code Flow`.
337
+
With a customized `ActiveDirectoryAuthenticationProvider` class, a user-defined application client ID can be passed to SqlClient when a supported Microsoft Entra authentication mode is in use. Supported Microsoft Entra authentication modes include `Active Directory Integrated`, `Active Directory Interactive`, `Active Directory Service Principal`, `Active Directory Device Code Flow`, and `Active Directory Password`[DEPRECATED].
336
338
337
339
The application client ID is also configurable via `SqlAuthenticationProviderConfigurationSection` or `SqlClientAuthenticationProviderConfigurationSection`. The configuration property `applicationClientId` applies to .NET Framework 4.6+ and .NET Core 2.1+.
Copy file name to clipboardExpand all lines: docs/connect/jdbc/connecting-using-azure-active-directory-authentication.md
+15-17Lines changed: 15 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Connect using Microsoft Entra authentication
3
3
description: Learn how to develop Java applications that use the Microsoft Entra authentication feature with the Microsoft JDBC Driver for SQL Server.
4
4
author: David-Engel
5
5
ms.author: davidengel
6
-
ms.date: 03/17/2025
6
+
ms.date: 01/16/2026
7
7
ms.service: sql
8
8
ms.subservice: connectivity
9
9
ms.topic: integration
@@ -17,7 +17,6 @@ This article provides information on how to develop Java applications that use t
17
17
18
18
You can use Microsoft Entra authentication, which is a mechanism to connect to Azure SQL Database, Azure SQL Manged Instance, and Azure Synapse Analytics using identities in Microsoft Entra ID. Use Microsoft Entra authentication to centrally manage identities of database users and as an alternative to SQL Server authentication. The JDBC driver allows you to specify your Microsoft Entra credentials in the JDBC connection string to connect to Azure SQL. For information on how to configure Microsoft Entra authentication visit [Connecting to Azure SQL By Using Microsoft Entra authentication](/azure/azure-sql/database/authentication-aad-overview).
19
19
20
-
21
20
Connection properties to support Microsoft Entra authentication in the Microsoft JDBC Driver for SQL Server are:
22
21
23
22
-**authentication**: Use this property to indicate which SQL authentication method to use for the connection.
@@ -30,9 +29,6 @@ Connection properties to support Microsoft Entra authentication in the Microsoft
30
29
-**ActiveDirectoryIntegrated**
31
30
- Since driver version 6.0, `authentication=ActiveDirectoryIntegrated` can be used to connect to Azure SQL/Synapse Analytics via integrated authentication. To use this authentication mode, you must [federate](/azure/active-directory/hybrid/connect/whatis-fed) the on-premises Active Directory Federation Services (ADFS) with Microsoft Entra ID in the cloud. Once you set it up, you can connect by either adding the native library `mssql-jdbc_auth-<version>-<arch>.dll` to the application class path on Windows, or by setting up a Kerberos ticket for cross-platform authentication support. You're able to access Azure SQL/Azure Synapse Analytics without being prompted for credentials when you're logged in to a domain-joined machine. For more information, see [Connect using ActiveDirectoryIntegrated authentication mode](#connect-using-activedirectoryintegrated-authentication-mode).
32
31
33
-
-**ActiveDirectoryPassword**
34
-
- Since driver version 6.0, `authentication=ActiveDirectoryPassword` can be used to connect to Azure SQL/Synapse Analytics with Microsoft Entra username and password. For more information, see [Connect using ActiveDirectoryPassword authentication mode](#connect-using-activedirectorypassword-authentication-mode).
35
-
36
32
-**ActiveDirectoryInteractive**
37
33
- Since driver version 9.2, `authentication=ActiveDirectoryInteractive` can be used to connect to an Azure SQL/Synapse Analytics via interactive authentication flow (multifactor authentication). For more information, see [Connect using ActiveDirectoryInteractive authentication mode](#connect-using-activedirectoryinteractive-authentication-mode).
38
34
@@ -41,10 +37,14 @@ Connection properties to support Microsoft Entra authentication in the Microsoft
41
37
42
38
-**ActiveDirectoryServicePrincipalCertificate**
43
39
- Since driver version 12.4, `authentication=ActiveDirectoryServicePrincipalCertificate` can be used to connect to an Azure SQL Database/Synapse Analytics by specifying the application/client ID in the userName property and the location of the Service Principal certificate in the `clientCertificate` property. For more information, see [Connect using ActiveDirectoryServicePrincipalCertificate authentication mode](#connect-using-activedirectoryserviceprincipalcertificate-authentication-mode).
40
+
-**ActiveDirectoryPassword [DEPRECATED]**
41
+
- ActiveDirectoryPassword is deprecated. For more information, see [Connect using ActiveDirectoryPassword authentication mode](#connect-using-activedirectorypassword-authentication-mode).
42
+
- Since driver version 6.0, `authentication=ActiveDirectoryPassword` can be used to connect to Azure SQL/Synapse Analytics with Microsoft Entra username and password. For more information, see [Connect using ActiveDirectoryPassword authentication mode](#connect-using-activedirectorypassword-authentication-mode).
43
+
44
44
-**SqlPassword**
45
45
- Use `authentication=SqlPassword` to connect to a SQL Server using userName/user and password properties.
46
46
-**NotSpecified**
47
-
-Use `authentication=NotSpecified` or leave it as the default when none of these authentication methods are needed.
47
+
-The default value when none of these authentication methods are specified.
48
48
-**accessToken**: Use this connection property to connect to a SQL Database with access token. `accessToken` can only be set using the Properties parameter of the `getConnection()` method in the DriverManager class. It can't be used in the connection URL.
49
49
50
50
For more information, see the authentication property on the [Setting the Connection Properties](setting-the-connection-properties.md) page.
@@ -289,7 +289,7 @@ You have successfully logged on as: <your domain user name>
289
289
290
290
### Set Kerberos ticket on Windows, Linux And macOS
291
291
292
-
You must up a Kerberos ticket to link your current user to a Windows domain account. Following is a summary of the key steps.
292
+
You must set up a Kerberos ticket to link your current user to a Windows domain account. Following is a summary of the key steps.
293
293
294
294
#### Windows
295
295
@@ -359,6 +359,8 @@ Access to a Windows domain-joined machine to query your Kerberos Domain Controll
359
359
360
360
## Connect using ActiveDirectoryPassword authentication mode
The following example shows how to use `authentication=ActiveDirectoryPassword` mode.
363
365
364
366
To build and run the example:
@@ -415,7 +417,6 @@ If the connection is established, you should see the following message as output
415
417
You have successfully logged on as: <your user name>
416
418
```
417
419
418
-
419
420
## Connect using ActiveDirectoryInteractive authentication mode
420
421
421
422
The following example shows how to use `authentication=ActiveDirectoryInteractive` mode.
@@ -612,12 +613,10 @@ If a connection is established, you should see the following message as output:
612
613
You have successfully logged on as: <your app/client ID>
613
614
```
614
615
615
-
616
616
## Connect using access token
617
617
618
618
Applications/services can retrieve an access token from Microsoft Entra ID and use that to connect to Azure SQL Database, Azure SQL Managed Instance, and Azure Synapse Analytics.
619
619
620
-
621
620
> [!NOTE]
622
621
> `accessToken` can only be set using the Properties parameter of the `getConnection()` method in the DriverManager class. It can't be used in the connection string. Starting with driver version 12.2, users can implement and provide an `accessToken` callback to the driver fortoken renewalin connection pooling scenarios. Connection pooling scenarios require the connection pool implementation to use the standard [JDBC connection pooling classes](using-connection-pooling.md).
623
622
@@ -633,16 +632,15 @@ To build and run the example:
633
632
5. Enter `mytokentest` as a friendly name for the application.
634
633
6. Leave the default selection for supported account types, which can use the application.
635
634
7. Select **Register** at the bottom.
636
-
6. Don't need SIGN-ON URL. Provide anything: `https://mytokentest`.
637
-
7. Select `Create` at the bottom.
638
-
8. Upon selecting **Register**, the app is immediately created, and you're taken to its resource page.
639
-
9. In the **Essentials** box, find the **Application (client) ID** and copy it. You need this value later to configure your application.
640
-
10. Select **Certificates & secrets** from the navigation pane. On the **Client secrets (0)** tab, select**New client secret**. Enter a description for the secret and selectan expiration (the default is fine). Select **Add** at the bottom. **Important** before leaving this page, copy the generated **Value**for your client secret. This value can't be viewed after leaving the page. This value is the client secret.
641
-
11. Return to the [App registrations](https://ms.portal.azure.com/#view/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/~/RegisteredApps) pane for Microsoft Entra ID and find the **Endpoints** tab. Copy the URL under `OAuth 2.0 token endpoint`. This URL is your STS URL.
635
+
8. Don't need SIGN-ON URL. Provide anything: `https://mytokentest`.
636
+
9. Select `Create` at the bottom.
637
+
10. Upon selecting **Register**, the app is immediately created, and you're taken to its resource page.
638
+
11. In the **Essentials** box, find the **Application (client) ID** and copy it. You need this value later to configure your application.
639
+
12. Select **Certificates & secrets** from the navigation pane. On the **Client secrets (0)** tab, select**New client secret**. Enter a description for the secret and selectan expiration (the default is fine). Select **Add** at the bottom. **Important** before leaving this page, copy the generated **Value**for your client secret. This value can't be viewed after leaving the page. This value is the client secret.
640
+
13. Return to the [App registrations](https://ms.portal.azure.com/#view/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/~/RegisteredApps) pane for Microsoft Entra ID and find the **Endpoints** tab. Copy the URL under `OAuth 2.0 token endpoint`. This URL is your STS URL.
642
641
643
642
1. Connect to your database as a Microsoft Entra admin and use a T-SQL command to provision a contained database user for your application principal. For more information on how to create a Microsoft Entra admin and a contained database user, see the [Connecting by using Microsoft Entra authentication](/azure/azure-sql/database/authentication-aad-overview).
0 commit comments