3

I want to use an Always Encrypted SQL 2016 DB in my .NET app with an Azure Key Vault for storing the encryption keys. I have been following this article so far: https://blogs.msdn.microsoft.com/sqlsecurity/2015/11/10/using-the-azure-key-vault-key-store-provider-for-always-encrypted/

But I receive an exception when I reach this line of the code provided in the article:

SqlColumnEncryptionAzureKeyVaultProvider azureKeyVaultProvider =
new SqlColumnEncryptionAzureKeyVaultProvider(GetToken);

The exception is:

Additional information: Method not found: 'Void Microsoft.Azure.KeyVault.KeyVaultClient..ctor(AuthenticationCallback)'.

I've checked my references and everythings seems to be in place. The GetToken authentication callback method is also there.

Can anyone help? Thanks.

Daniel D.
  • 71
  • 6

3 Answers3

4

It seems like the issue with the latest Microsoft.Azure.KeyVault nuget package. Microsoft.SqlServer.Management.AlwaysEncrypted.AzureKeyVaultProvider package has a dependency on Microsoft.Azure.KeyVault v 1.0.0 and if you install the latest version (v 2.0.6) it brakes SqlColumnEncryptionAzureKeyVaultProvider. Downgrade Microsoft.Azure.KeyVault package to v 1.0.0 and you will be fine...

Alex Pryiomka
  • 391
  • 3
  • 11
  • I tried downgrading but things didn't work out. I ended up using another custom implementation of SqlColumnEncryptionProvider that uses the Azure Key Vault. – Daniel D. Dec 16 '16 at 12:46
2

This is a known issue of aspnet/Configuration. See https://github.com/aspnet/Configuration/issues/569

Zhiliang
  • 101
  • 5
0

Please use version 2.0.20170208 or greater of the nuget package, this should resolve your problem.