| title | Example demonstrating use of Azure Key Vault provider with Always Encrypted |
|---|---|
| description | Learn how to use the Azure Key Vault provider with Always Encrypted in Microsoft.Data.SqlClient to access encrypted columns from .NET applications. |
| author | dlevy-msft-sql |
| ms.author | dlevy |
| ms.reviewer | davidengel, paulmedynski, cmalhotra |
| ms.date | 06/23/2026 |
| ms.service | sql |
| ms.subservice | connectivity |
| ms.topic | tutorial |
[!INCLUDE sqlserver2019-windows-only]
This example demonstrates how to use the Azure Key Vault provider to access encrypted columns.
[!code-csharp Azure Key Vault Provider 2.0 Example#1]
[!code-csharp Azure Key Vault Provider Example#1]
Note
-
To use the Always Encrypted feature without secure enclaves for a .NET Standard application, you need Microsoft.Data.SqlClient 2.1.0 or later. .NET Standard 2.0 or later is supported.
-
To use the Always Encrypted feature on Linux and macOS, you need Microsoft.Data.SqlClient 2.1.0 or later.