Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 1.72 KB

File metadata and controls

37 lines (27 loc) · 1.72 KB
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

Example demonstrating use of Azure Key Vault provider with Always Encrypted

[!INCLUDE sqlserver2019-windows-only]

This example demonstrates how to use the Azure Key Vault provider to access encrypted columns.

AzureKeyVaultProvider v2.0+

[!code-csharp Azure Key Vault Provider 2.0 Example#1]

AzureKeyVaultProvider v1.x

[!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.

Related content