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: azure-sql/database/connectivity-architecture.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,9 @@ Servers in SQL Database and Azure Synapse support the following three options fo
48
48
49
49
We highly recommend the `Redirect` connection policy over the `Proxy` connection policy for the lowest latency and highest throughput. However, you will need to meet the additional requirements for allowing network traffic as outlined above. If the client is an Azure Virtual Machine, you can accomplish this using Network Security Groups (NSG) with [service tags](/azure/virtual-network/network-security-groups-overview#service-tags). If the client is connecting from a workstation on-premises then you may need to work with your network admin to allow network traffic through your corporate firewall.
50
50
51
+
> [!IMPORTANT]
52
+
> Connections to private endpoint only support **Proxy** as the [connection policy](connectivity-architecture.md#connection-policy).
53
+
51
54
## Connectivity from within Azure
52
55
53
56
If you are connecting from within Azure your connections have a connection policy of `Redirect` by default. A policy of `Redirect` means that after the TCP session is established to Azure SQL Database, the client session is then redirected to the right database cluster with a change to the destination virtual IP from that of the Azure SQL Database gateway to that of the cluster. Thereafter, all subsequent packets flow directly to the cluster, bypassing the Azure SQL Database gateway. The following diagram illustrates this traffic flow.
Starting with Microsoft.Data.SqlClient 4.0, TLS 1.3 is not supported by the driver and has been removed from the supported protocols list by default. Users can switch back to forcing use of the operating system's client protocols, by setting the AppContext switch **"Switch.Microsoft.Data.SqlClient.UseSystemDefaultSecureProtocols"** to true:
25
+
Starting with Microsoft.Data.SqlClient 4.0, TLS 1.3 isn't supported by the driver and has been removed from the supported protocols list by default. Users can switch back to forcing use of the operating system's client protocols, by setting the AppContext switch **"Switch.Microsoft.Data.SqlClient.UseSystemDefaultSecureProtocols"** to true:
Starting with version 5.0, TLS 1.3 is supported in TDS 8 connections without having to use the above switch. TDS 8 is enabled when `Encrypt` is set to `Strict`.
This switch will toggle the driver's behavior to use a managed networking implementation in .NET Core 2.1+ and .NET Standard 2.0+ projects on Windows, eliminating all dependencies on native libraries for the Microsoft.Data.SqlClient library. It is intended for testing and debugging purposes only.
55
+
This switch will toggle the driver's behavior to use a managed networking implementation in .NET Core 2.1+ and .NET Standard 2.0+ projects on Windows, eliminating all dependencies on native libraries for the Microsoft.Data.SqlClient library. It's intended for testing and debugging purposes only.
54
56
55
57
> [!NOTE]
56
58
> There are some known differences when compared to the native implementation. For example, the managed implementation does not support non-domain Windows Authentication.
@@ -59,7 +61,7 @@ This switch will toggle the driver's behavior to use a managed networking implem
Transparent Network IP Resolution (TNIR) is a revision of the existing MultiSubnetFailover feature. TNIR affects the connection sequence of the driver in the case where the first resolved IP of the hostname does not respond and there are multiple IPs associated with the hostname. TNIR interacts with MultiSubnetFailover to provide the following three connection sequences:
64
+
Transparent Network IP Resolution (TNIR) is a revision of the existing MultiSubnetFailover feature. TNIR affects the connection sequence of the driver in the case where the first resolved IP of the hostname doesn't respond and there are multiple IPs associated with the hostname. TNIR interacts with MultiSubnetFailover to provide the following three connection sequences:
63
65
64
66
* 0: One IP is attempted, followed by all IPs in parallel
The <xref:Microsoft.Data.SqlClient> has a `Connection` object that inherits from <xref:System.Data.Common.DbConnection>as well as a provider-specific <xref:System.Data.Common.DbConnection.ConnectionString%2A> property. The specific connection string syntax for the SqlClient provider is documented in its `ConnectionString` property. For more information on connection string syntax, see <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>.
19
+
The <xref:Microsoft.Data.SqlClient> has a `Connection` object that inherits from <xref:System.Data.Common.DbConnection>and a provider-specific <xref:System.Data.Common.DbConnection.ConnectionString%2A> property. The specific connection string syntax for the SqlClient provider is documented in its `ConnectionString` property. For more information on connection string syntax, see <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>.
20
20
21
21
## Connection string builders
22
22
23
23
Microsoft SqlClient Data Provider for SQL Server introduced the following connection string builder.
The connection string builders allow you to construct syntactically valid connection strings at run time, so you do not have to manually concatenate connection string values in your code. For more information, see [Connection String Builders](connection-string-builders.md).
27
+
The connection string builders allow you to construct syntactically valid connection strings at run time, so you don't have to manually concatenate connection string values in your code. For more information, see [Connection String Builders](connection-string-builders.md).
28
28
29
29
## Windows authentication
30
30
@@ -62,7 +62,7 @@ Windows Authentication is preferred for connecting to SQL Server. However, if SQ
When you connect to Azure SQL Database or to Azure Synapse Analytics and provide a login in the format `user@servername`, make sure that the `servername` value in the login matches the value provided for `Server=`.
65
+
When you connect to Azure SQL Database or to Azure Synapse Analytics and provide a username in the format `user@servername`, make sure that the `servername` value in the username matches the value provided for `Server=`.
66
66
67
67
> [!NOTE]
68
68
> Windows authentication takes precedence over SQL Server logins. If you specify both Integrated Security=true as well as a user name and password, the user name and password will be ignored and Windows authentication will be used.
@@ -79,7 +79,7 @@ You can also set the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.D
79
79
80
80
### Type system version changes
81
81
82
-
The `Type System Version` keyword in a <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A?displayProperty=nameWithType> specifies the client-side representation of SQL Server types. See <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A?displayProperty=nameWithType> for more information about the `Type System Version` keyword.
82
+
The `Type System Version` keyword in a <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A?displayProperty=nameWithType> specifies the client-side representation of SQL Server types. For more information about the `Type System Version` keyword, see <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A?displayProperty=nameWithType>.
83
83
84
84
## Connect and Attach to SQL Server Express user instances
85
85
@@ -91,31 +91,43 @@ For more information on working with user instances, see [SQL Server Express Use
91
91
92
92
The `TrustServerCertificate` keyword is valid only when connecting to a SQL Server instance with a valid certificate. When `TrustServerCertificate` is set to `true`, the transport layer will use TLS/SSL to encrypt the channel and bypass walking the certificate chain to validate trust.
93
93
94
+
This setting is ignored when `Encrypt` is set to `Strict`. The server certificate is always validated in `Strict` mode.
95
+
94
96
```csharp
95
97
"TrustServerCertificate=true;"
96
98
```
97
99
98
100
> [!NOTE]
99
101
> If `TrustServerCertificate` is set to `true` and encryption is turned on, the encryption level specified on the server will be used even if `Encrypt` is set to `false` in the connection string. The connection will fail otherwise.
100
102
103
+
## HostNameInCertificate
104
+
105
+
Starting in version 5.0 of Microsoft.Data.SqlClient, HostNameInCertificate is a new connection option. When the driver validates server certificates, it ensures that the Common Name (CN) or Subject Alternate Name (SAN) in the certificate matches the server name being connected to. In some cases, like DNS aliases, the server name might not match the CN or SAN. The HostNameInCertificate value can be used to specify a different, expected CN or SAN in the server certificate.
106
+
107
+
```csharp
108
+
"HostNameInCertificate=myserver.example.com"
109
+
```
110
+
101
111
### Enable encryption
102
112
103
-
To enable encryption when a certificate has not been provisioned on the server, the **Trust Server Certificate** connection property must be set. In this case, encryption will use a self-signed server certificate without validation since no verifiable certificate has been provisioned on the server.
113
+
To enable encryption when a certificate hasn't been provisioned on the server, the **Trust Server Certificate** connection property must be set. In this case, encryption will use a self-signed server certificate without validation since no verifiable certificate has been provisioned on the server.
104
114
105
-
Application settings cannot reduce the level of security configured in SQL Server, but can optionally strengthen it. An application can request encryption by setting the `TrustServerCertificate` and `Encrypt` keywords to `true`, guaranteeing that encryption takes place even when a server certificate has not been provisioned. However, if `TrustServerCertificate`is not enabled in the client configuration, a provisioned server certificate is still required.
115
+
Application settings can't reduce the level of security configured in SQL Server, but can optionally strengthen it. An application can request encryption by setting the `TrustServerCertificate` and `Encrypt` keywords to `true`, guaranteeing that encryption takes place even when a server certificate hasn't been provisioned. However, if `TrustServerCertificate`isn't enabled in the client configuration, a provisioned server certificate is still required.
106
116
107
117
The following table describes all cases.
108
118
109
119
| Encrypt connection string/attribute | Trust Server Certificate connection string/attribute | Result |
110
120
|--|--|--|
111
-
| No | Ignored | No encryption occurs. |
112
-
| Yes | No | Encryption occurs only if there is a verifiable server certificate, otherwise the connection attempt fails. |
113
-
| Yes | Yes | Encryption always occurs, but may use a self-signed server certificate. |
121
+
| No/Optional | Ignored | No encryption occurs. |
122
+
| Yes/Mandatory | No | Encryption occurs only if there's a verifiable server certificate, otherwise the connection attempt fails. |
123
+
| Yes/Mandatory | Yes | Encryption always occurs, but may use a self-signed server certificate. |
124
+
| Yes/Mandatory | Yes | Encryption always occurs, but may use a self-signed server certificate. |
125
+
| Strict<sup>1</sup> | Ignored | Encryption always occurs and must use a verifiable server certificate, otherwise the connection attempt fails. |
114
126
115
-
For more information, see [Using Encryption Without Validation](../../relational-databases/native-client/features/using-encryption-without-validation.md).
127
+
<sup>1</sup> Strict encryption is only available starting with Microsoft.Data.SqlClient version 5.0.
116
128
117
129
## See also
118
130
119
131
-[Connection strings](connection-strings.md)
120
132
-[Connecting to a data source](connecting-to-data-source.md)
121
-
-[Microsoft ADO.NET for SQL Server](microsoft-ado-net-sql-server.md)
133
+
-[Microsoft ADO.NET for SQL Server](microsoft-ado-net-sql-server.md)
Copy file name to clipboardExpand all lines: docs/connect/ado-net/download-microsoft-sqlclient-data-provider.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Download Microsoft SqlClient Data Provider for SQL Server
3
3
description: Download page for ADO.NET and Microsoft SqlClient Data Provider for SQL Server.
4
-
ms.date: 05/19/2022
4
+
ms.date: 07/26/2022
5
5
dev_langs:
6
6
- "csharp"
7
7
ms.assetid: 6f5ff56a-a57e-49d7-8ae9-bbed697e42e3
@@ -14,14 +14,15 @@ ms.author: v-davidengel
14
14
---
15
15
# Download Microsoft SqlClient Data Provider for SQL Server
16
16
17
-
The Microsoft.Data.SqlClient library is distributed as a NuGet package. Simply add a NuGet reference to Microsoft.Data.SqlClient. NuGet packages are easily consumed directly from a .NET project without the need to manually download anything. If you use Visual Studio for development, see [Install and use a package](/nuget/quickstart/install-and-use-a-package-in-visual-studio). For other ways to consume a NuGet package, see the [NuGet documentation](/nuget).
17
+
The Microsoft.Data.SqlClient library is distributed as a NuGet package. Add a NuGet reference to Microsoft.Data.SqlClient. NuGet packages are easily consumed directly from a .NET project without the need to manually download anything. If you use Visual Studio for development, see [Install and use a package](/nuget/quickstart/install-and-use-a-package-in-visual-studio). For other ways to consume a NuGet package, see the [NuGet documentation](/nuget).
18
18
19
19
## Downloading the driver
20
20
21
21
If you need to download the Microsoft.Data.SqlClient package for offline use, it's available on NuGet.org. Refer to the dependencies section from the links below to download the dependencies.
22
22
23
23
## Download stable versions of Microsoft SqlClient Data Provider for SQL Server
0 commit comments