【发布时间】:2016-06-09 17:45:17
【问题描述】:
我已使用 Always Encrypted 和存储在 Azure Key Vault 中的列主密钥加密了 Azure SQL 数据库中的一些列,但我无法使用 Entity Framework 从我的应用程序访问它们。
最近有一个MSDN article 和一个older blog post 解释了如何设置一个SqlConnection 以使用Azure Key Vault 的Always Encrypted,所以我猜可以使用constructor 创建一个普通的DbContext接受DbConnection。
问题是我正在使用一个IdentityDbContext,它没有那个构造函数 - 唯一一个采用DbConnection 的constructor 也采用一个DbCompiledModel,这超出了我在瞬间。
谁能解释如何设置 IdentityDbContext 以使用 Key Vault?
【问题讨论】:
-
我正在调查...发现提到在 ConnectionString 中添加“Column Encryption Setting=Enabled”,并且需要为加密列添加 SqlParameter。这里:azure.microsoft.com/en-us/documentation/articles/…你是在加密一列还是整个数据库?
标签: sql-server entity-framework azure-keyvault always-encrypted