I've encrypted some columns in an Azure SQL Database, using Always Encrypted and a column master key stored in an Azure Key Vault, but I'm having trouble accessing them from my application using Entity Framework.
There's a recent MSDN article and an older blog post that explain how to set up a SqlConnection to use Always Encrypted with an Azure Key Vault, so I'm guessing that a normal DbContext could be created using the constructor that accepts a DbConnection
.
The problem is that I'm using an IdentityDbContext
, which doesn't have that constructor - the only constructor that takes a DbConnection
also takes a DbCompiledModel
, which is beyond my pay-grade at the moment.
Can anyone explain how to set up an IdentityDbContext
to use the Key Vault?