Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider
7.0.0-preview1.26064.3
Prefix Reserved
Requires NuGet 2.12 or higher.
dotnet add package Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider --version 7.0.0-preview1.26064.3
NuGet\Install-Package Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider -Version 7.0.0-preview1.26064.3
<PackageReference Include="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider" Version="7.0.0-preview1.26064.3" />
<PackageVersion Include="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider" Version="7.0.0-preview1.26064.3" />
<PackageReference Include="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider" />
paket add Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider --version 7.0.0-preview1.26064.3
#r "nuget: Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider, 7.0.0-preview1.26064.3"
#:package Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider@7.0.0-preview1.26064.3
#addin nuget:?package=Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider&version=7.0.0-preview1.26064.3&prerelease
#tool nuget:?package=Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider&version=7.0.0-preview1.26064.3&prerelease
Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider
Description
This library provides an Always Encrypted Azure Key Vault Provider for Microsoft.Data.SqlClient. It enables .NET applications to use Microsoft Azure Key Vault with Always Encrypted in Microsoft Azure SQL Database and Microsoft SQL Server.
Always Encrypted allows clients to encrypt sensitive data inside client applications and never reveal the encryption keys to SQL Server. This provider enables storing column master keys (CMKs) in Azure Key Vault, providing centralized key management, secure key storage, and integration with Azure AD authentication.
Supportability
This package supports:
- .NET Framework 4.6.2+
- .NET 8.0+
Installation
Install the package via NuGet:
dotnet add package Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider
Or via the Package Manager Console:
Install-Package Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider
Getting Started
Register the Provider
Before you can use Azure Key Vault with Always Encrypted, you must register the provider globally or per-connection:
using Microsoft.Data.SqlClient;
using Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider;
using Azure.Identity;
// Create the AKV provider using Azure.Identity (recommended)
var azureCredential = new DefaultAzureCredential();
var akvProvider = new SqlColumnEncryptionAzureKeyVaultProvider(azureCredential);
// Register globally (once per application)
SqlConnection.RegisterColumnEncryptionKeyStoreProviders(
new Dictionary<string, SqlColumnEncryptionKeyStoreProvider>
{
{ SqlColumnEncryptionAzureKeyVaultProvider.ProviderName, akvProvider }
});
Use with a Connection
Enable Always Encrypted in your connection string:
var connectionString = "Server=myserver;Database=mydb;Column Encryption Setting=Enabled;...";
using var connection = new SqlConnection(connectionString);
await connection.OpenAsync();
// Execute queries against encrypted columns - encryption/decryption is automatic
using var command = new SqlCommand("SELECT SSN FROM Customers WHERE Id = @id", connection);
command.Parameters.AddWithValue("@id", customerId);
var ssn = await command.ExecuteScalarAsync();
Key Features
- Azure Key Vault Integration: Store and manage column master keys (CMKs) in Azure Key Vault
- Azure AD Authentication: Supports Azure.Identity credentials for seamless Azure AD authentication
- Key Caching: Built-in caching of column encryption keys (CEKs) for improved performance
- Multiple Authentication Methods: Supports DefaultAzureCredential, ClientSecretCredential, ManagedIdentityCredential, and more
Documentation
- Always Encrypted Overview
- Configure Always Encrypted with Azure Key Vault
- Microsoft.Data.SqlClient Documentation
- Azure Key Vault Documentation
Release Notes
Release notes are available at: https://go.microsoft.com/fwlink/?linkid=2090501
License
This package is licensed under the MIT License.
Related Packages
- Microsoft.Data.SqlClient - The main SqlClient driver
- Azure.Identity - Azure AD authentication library
- Azure.Security.KeyVault.Keys - Azure Key Vault Keys client library
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.2
- Azure.Core (>= 1.49.0)
- Azure.Security.KeyVault.Keys (>= 4.8.0)
- Microsoft.Data.SqlClient (>= 7.0.0-preview4.26064.3)
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
-
net8.0
- Azure.Core (>= 1.49.0)
- Azure.Security.KeyVault.Keys (>= 4.8.0)
- Microsoft.Data.SqlClient (>= 7.0.0-preview4.26064.3)
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider:
| Package | Downloads |
|---|---|
|
SealReportLibrary.NETCore
Provides the objects to create, load and execute reports using the Seal Report framework. A full repository file structure must be available on the machine running the program. |
|
|
TryIT.SqlAdo.MicrosoftSqlClient
SQL DB Connector via Ado.Net, with Column Encryption supported |
|
|
Mmp.Gateway.Commons
Package Description |
|
|
PAYPKG.SharedLibs
.Net Core Shared libraries. Includes the Data and Entities packages |
|
|
AzureSecureAccess
A modern .NET library for secure access to Azure Key Vault secrets, certificates, and SQL Server Always Encrypted. Supports flexible authentication (Client Secret, Certificate, Managed Identity, DefaultAzureCredential), in-memory caching, structured logging, and built-in Polly retry policies. |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider:
| Repository | Stars |
|---|---|
|
ariacom/Seal-Report
Database Reporting Tool and Tasks (.Net)
|
|
|
microsoft/sqltoolsservice
SQL Tools API service that provides SQL Server data management capabilities.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 7.0.0-preview1.26064.3 | 116 | 3/5/2026 |
| 6.1.2 | 474,758 | 8/20/2025 |
| 6.1.1 | 9,090 | 8/15/2025 |
| 6.1.0 | 12,631 | 7/31/2025 |
| 6.0.0 | 512,092 | 1/30/2025 |
| 5.1.0 | 1,819,425 | 2/2/2024 |
| 3.0.0 | 2,523,646 | 6/14/2021 |
| 2.0.0 | 216,361 | 3/3/2021 |
| 1.2.0 | 503,042 | 12/1/2020 |
| 1.1.1 | 679,654 | 3/3/2020 |
| 1.0.0 | 96,194 | 11/19/2019 |
| 1.0.0-preview1.19295.2 | 5,538 | 10/22/2019 |
| 1.0.0-preview1.19292.1 | 698 | 10/19/2019 |