# Migrate SQL Server Always Encrypted CMK to AWS Secrets Manager with .NET

DevFeed: [Migrate SQL Server Always Encrypted CMK to AWS Secrets Manager with .NET](<https://devfeed.tech/articles/migrate-sql-server-always-encrypted-cmk-to-aws-secrets-manager-with-net-128934.md>)

Original publisher: [Read original article](<https://aws.amazon.com/blogs/dotnet/migrate-sql-server-always-encrypted-cmk-to-aws-secrets-manager-with-net/>)

Author: Akber Rizwan Shaik

Published: 2026-11-10T12:32:30Z

Content type: tutorial

Language: en

Sources: [.NET on AWS Blog](<https://devfeed.tech/sources/net-on-aws-blog.md>)

Topics: [Secrets Management](<https://devfeed.tech/topics/secrets-management.md>), [sql-server](<https://devfeed.tech/topics/sql-server.md>), [.NET](<https://devfeed.tech/topics/net.md>), [Amazon Web Services](<https://devfeed.tech/topics/aws.md>), [NuGet](<https://devfeed.tech/topics/nuget.md>), [C#](<https://devfeed.tech/topics/csharp.md>), [ASP.NET Core](<https://devfeed.tech/topics/asp-net-core.md>)

Tags: [amazon-elastic-container-service](<https://devfeed.tech/tags/amazon-elastic-container-service.md>), [amazon-elastic-kubernetes-service](<https://devfeed.tech/tags/amazon-elastic-kubernetes-service.md>), [asp-net](<https://devfeed.tech/tags/asp-net.md>), [asp-net-core](<https://devfeed.tech/tags/asp-net-core.md>), [aws](<https://devfeed.tech/tags/aws.md>), [aws-cli](<https://devfeed.tech/tags/aws-cli.md>), [aws-identity-and-access-management-iam](<https://devfeed.tech/tags/aws-identity-and-access-management-iam.md>), [aws-key-management-service](<https://devfeed.tech/tags/aws-key-management-service.md>), [aws-key-management-service-aws-kms](<https://devfeed.tech/tags/aws-key-management-service-aws-kms.md>), [aws-lambda](<https://devfeed.tech/tags/aws-lambda.md>), [aws-secrets-manager](<https://devfeed.tech/tags/aws-secrets-manager.md>), [certificate](<https://devfeed.tech/tags/certificate.md>), [encrypted](<https://devfeed.tech/tags/encrypted.md>), [key](<https://devfeed.tech/tags/key.md>), [migrate](<https://devfeed.tech/tags/migrate.md>), [net](<https://devfeed.tech/tags/net.md>), [net-10](<https://devfeed.tech/tags/net-10.md>), [secrets-manager](<https://devfeed.tech/tags/secrets-manager.md>), [sql-server](<https://devfeed.tech/tags/sql-server.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>), [windows](<https://devfeed.tech/tags/windows.md>)

## AI overview

The excerpt describes moving SQL Server Always Encrypted's column master key from the Windows Certificate Store to AWS Secrets Manager so a .NET application can run on Linux. Export the certificate and private key as a PFX, store it and its password as separate secrets, then implement and register a custom SqlColumnEncryptionKeyStoreProvider. A Windows migration utility unwraps each existing column encryption key (CEK) with the old provider and re-wraps it with the new one; the CEK and encrypted table data stay unchanged. Keep both wrapped values until queries validate, then optionally remove the old values and CMK. The one-time migration utility still requires Windows access to the certificate store, while the application can run cross-platform afterward. Dropping the old CMK can prevent SSMS and other clients without the custom provider from decrypting columns. The excerpt also notes that the sample decryption code omits signature verification and suggests adding it if the threat model requires it.

## Source excerpt

Introduction By migrating the SQL Server Always Encrypted column master key (CMK) from the Windows Certificate Store to AWS Secrets Manager, you can remove a Windows-only platform dependency from your .NET application. The default CMK store provider, MSSQL_CERTIFICATE_STORE, relies on the Windows Certificate Store. The CMK must move to a platform-agnostic store like AWS Secrets [...]