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/includes/virtual-machines-sql-server-akv-next-steps.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ The following Transact-SQL scripts provide examples for each of these areas.
19
19
20
20
Each example is based on the two prerequisites: an asymmetric key from your key vault called **CONTOSO_KEY** and a credential created by the AKV Integration feature called **Azure_EKM_cred**. The following Transact-SQL commands setup these prerequisites for running the examples.
Open Notepad and copy the following lines of data into a new text file and then save this file to your local temp directory, `C:\Temp\DimDate2.txt`. This data is in ASCII format.
Copy file name to clipboardExpand all lines: docs/connect/ado-net/sql/azure-active-directory-authentication.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ When the application is connecting to Azure SQL data sources by using Microsoft
59
59
60
60
`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
61
62
-
```cs
62
+
```csharp
63
63
// Use your own server, database, user ID, and password.
+"Authentication=Active Directory Service Principal; Encrypt=True;"
@@ -158,7 +158,7 @@ The following code snippet is an example of using `Active Directory Device Code
158
158
> [!NOTE]
159
159
> The timeout for `Active Directory Device Code Flow` defaults to the connection's `Connect Timeout` setting. Make sure to specify a `Connect Timeout` that provides enough time to go through the device code flow authentication process.
160
160
161
-
```cs
161
+
```csharp
162
162
// Use your own server and database and increase Connect Timeout as needed for
@@ -208,7 +208,7 @@ using (SqlConnection conn = new SqlConnection(ConnectionString2)) {
208
208
209
209
The following example demonstrates `Active Directory Managed Identity` authentication with a user-assigned managed identity with **Microsoft.Data.SqlClient v3.0 onwards**.
210
210
211
-
```cs
211
+
```csharp
212
212
// For user-assigned managed identity
213
213
// Use your own values for Server, Database, and User Id.
214
214
@@ -233,7 +233,7 @@ using (SqlConnection conn = new SqlConnection(ConnectionString2)) {
233
233
234
234
The following example demonstrates `Active Directory Managed Identity` authentication with a user-assigned managed identity with **Microsoft.Data.SqlClient v2.1**.
235
235
236
-
```cs
236
+
```csharp
237
237
// For user-assigned managed identity
238
238
// Use your own values for Server, Database, and User Id.
239
239
@@ -291,7 +291,7 @@ With this authentication mode, the driver acquires a token by passing "[DefaultA
291
291
292
292
The following example shows how to use **Active Directory Default** authentication.
@@ -307,7 +307,7 @@ Available starting in version 5.2, like with managed identities, [workload ident
307
307
308
308
The following example demonstrates `Active Directory Workload Identity` authentication with a user-assigned managed identity with **Microsoft.Data.SqlClient v5.2 onwards**.
309
309
310
-
```cs
310
+
```csharp
311
311
// Use your own values for Server, Database, and User Id.
@@ -389,7 +389,7 @@ The following example shows how to use a new authentication provider for `Active
389
389
390
390
In addition to improving the `Active Directory Interactive` authentication experience, **Microsoft.Data.SqlClient** 2.1.0 and later provide the following APIs for client applications to customize interactive authentication and device code flow authentication.
@@ -128,7 +128,7 @@ This example inserts a row into the Patients table. Note the following details:
128
128
- The data type of the parameter targeting the `SSN` column is set to an ANSI (non-Unicode) string, which maps to the char/varchar SQL Server data type. If the type of the parameter was set to a Unicode string (String), which maps to nchar/nvarchar, the query would fail, as Always Encrypted doesn't support conversions from encrypted nchar/nvarchar values to encrypted char/varchar values. See [SQL Server Data Type Mappings](/dotnet/framework/data/adonet/sql-server-data-type-mappings) for information about the data type mappings.
129
129
- The data type of the parameter inserted into the `BirthDate` column is explicitly set to the target SQL Server data type using the [SqlParameter.SqlDbType Property](/dotnet/api/microsoft.data.sqlclient.sqlparameter.sqldbtype), instead of relying on the implicit mapping of .NET types to SQL Server data types applied when using the [SqlParameter.DbType Property](/dotnet/api/microsoft.data.sqlclient.sqlparameter.dbtype). By default, the [DateTime Structure](/dotnet/api/system.datetime) maps to the datetime SQL Server data type. As the data type of the `BirthDate` column is date and Always Encrypted doesn't support a conversion of encrypted datetime values to encrypted date values, using the default mapping would result in an error.
using (SqlConnectionconnection=newSqlConnection(connectionString))
@@ -278,7 +278,7 @@ To prevent such errors, make sure:
278
278
- Always Encrypted is enabled for application queries targeting encrypted columns (for the connection string or in the [SqlCommand](/dotnet/api/microsoft.data.sqlclient.sqlcommand) object for a specific query).
279
279
- You use SqlParameter to send data targeting encrypted columns. The following example shows a query that incorrectly filters by a literal/constant on an encrypted column (SSN) instead of passing the literal inside a SqlParameter object.
280
280
281
-
```cs
281
+
```csharp
282
282
using (SqlCommandcmd=connection.CreateCommand())
283
283
{
284
284
cmd.CommandText=@"SELECT [SSN], [FirstName], [LastName], [BirthDate] FROM [dbo].[Patients] WHERE SSN = '795-73-9838'";
@@ -355,7 +355,7 @@ If you want to store column master keys in a key store that isn't supported by a
355
355
-[SqlConnection.RegisterColumnEncryptionKeyStoreProvidersOnConnection](/dotnet/api/microsoft.data.sqlclient.sqlconnection.registercolumnencryptionkeystoreprovidersonconnection) (Added in version 3.0.0)
356
356
-[SqlCommand.RegisterColumnEncryptionKeyStoreProvidersOnCommand](/dotnet/api/microsoft.data.sqlclient.sqlcommand.registercolumnencryptionkeystoreprovidersoncommand) (Added in version 3.0.0)
@@ -436,7 +436,7 @@ When the **Microsoft .NET Data Provider for SQL Server** accesses encrypted colu
436
436
Implementing your own key management tools may be required only if you use a custom key store provider. When using keys stored in keys stores, for which built-in providers exist, and or in Azure Key Vault, you can use existing tools, such as SQL Server Management Studio or PowerShell, to manage and provision keys.
437
437
The below example, illustrates generating a column encryption key and using the [SqlColumnEncryptionCertificateStoreProvider class](/dotnet/api/microsoft.data.sqlclient.sqlcolumnencryptioncertificatestoreprovider) to encrypt the key with a certificate.
438
438
439
-
```cs
439
+
```csharp
440
440
usingSystem.Security.Cryptography;
441
441
staticvoidMain(string[] args)
442
442
{
@@ -502,7 +502,7 @@ To control the Always Encrypted behavior of individual queries, you need to use
502
502
503
503
In the below example, Always Encrypted is disabled for the database connection. The query the application issues has a parameter that targets the LastName column that isn't encrypted. The query retrieves data from the `SSN` and `BirthDate` columns that are both encrypted. In such a case, calling **sys.sp_describe_parameter_encryption** to retrieve encryption metadata isn't required. However, the decryption of the query results needs to be enabled, so that the application can receive plaintext values from the two encrypted columns. The **SqlCommandColumnEncryptionSetting****ResultSetOnly** setting is used to ensure that.
using (SqlConnectionconnection=newSqlConnection(connectionString))
508
508
using (SqlCommandcmd=newSqlCommand(@"SELECT [SSN], [FirstName], [LastName], [BirthDate] FROM [dbo].[Patients] WHERE [LastName]=@LastName",
@@ -555,7 +555,7 @@ Although using the **SqlParameter.ForceColumnEncryption property** helps improve
555
555
556
556
The following code sample illustrates using the **SqlParameter.ForceColumnEncryption property** to prevent social security numbers from being sent in plaintext to the database.
557
557
558
-
```cs
558
+
```csharp
559
559
using (SqlCommandcmd=_sqlconn.CreateCommand())
560
560
{
561
561
// Use parameterized queries to access Always Encrypted data.
@@ -588,7 +588,7 @@ Although setting trusted key paths improves security of your application, you'll
588
588
589
589
The following example shows how to configure trusted column master key paths:
590
590
591
-
```cs
591
+
```csharp
592
592
// Configure trusted key paths to protect against fake key paths sent by a compromised SQL Server instance
593
593
// First, create a list of trusted key paths for your server
594
594
List<string>trustedKeyPathList=newList<string>();
@@ -612,7 +612,7 @@ With SqlBulkCopy, you can copy data, which is already encrypted and stored in on
612
612
613
613
Here's an example that copies data from one table to another. The `SSN` and `BirthDate` columns are assumed to be encrypted.
Copy file name to clipboardExpand all lines: docs/connect/php/installation-tutorial-linux-mac.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,14 +143,14 @@ sudo systemctl status nginx
143
143
144
144
To configure nginx, you must edit the `/etc/nginx/sites-available/default` file. Add `index.php` to the list below the section that says `# Add index.php to the list if you are using PHP`:
145
145
146
-
```config
146
+
```text
147
147
# Add index.php to the list if you are using PHP
148
148
index index.html index.htm index.nginx-debian.html index.php;
149
149
```
150
150
151
151
Next, uncomment and modify the section following `# pass PHP scripts to FastCGI server` as follows:
0 commit comments