Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider 7.0.0-preview1.26064.3

Prefix Reserved
This is a prerelease version of Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.

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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider" Version="7.0.0-preview1.26064.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider" Version="7.0.0-preview1.26064.3" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
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"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider@7.0.0-preview1.26064.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider&version=7.0.0-preview1.26064.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider&version=7.0.0-preview1.26064.3&prerelease
                    
Install as a Cake Tool

Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider

NuGet NuGet Downloads

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

Release Notes

Release notes are available at: https://go.microsoft.com/fwlink/?linkid=2090501

License

This package is licensed under the MIT License.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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