12

I am trying to use the "Always Encrypted" feature in SQL Server 2016 to encrypt some columns. I used this post as a guide to set the columns as encrypted in SSDT.

That part goes fine, it's when I attempt to query the data from the application that I get an error. According to the docs I need to add this:

column encryption setting=enabled

to my connection string. This does not appear to be supported in Entity Framework Core. I get this error:

column encryption setting=enabled is not supported

I tried using the SqlConnectionStringBuilder to build the string as well and the ability to add that setting is not there. It does appear to be there in .NET 4.6.

So, is anyone aware of a way to connect to an SQL server instance from a .NET Core application using Always Encrypted?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Brian
  • 2,318
  • 3
  • 19
  • 20
  • Does this answer your question? [SQL Server Always Encrypted with .NET Core not compatible](https://stackoverflow.com/questions/41027953/sql-server-always-encrypted-with-net-core-not-compatible) – Tim Bijnens Mar 03 '20 at 11:07

5 Answers5

5

Always Encrypted is currently not supported on .Net Core

You can find the list of supported frameworks here

Adding Support for .NET core is on our roadmap, we do not have timeline for it yet

Please follow this github issue for updates

  • Do you have a source for this? Otherwise this answer is just opinion. – DavidG Dec 16 '16 at 00:44
  • 2
    I should have mentioned this in the Answer, but, I am a part of Always Encrypted team :) – Nikhil Vithlani - Microsoft Dec 16 '16 at 00:50
  • Haha that is awesome, but to play devils advocate, anyone could say that! It's just good practice to link to some evidence, perhaps there's a github issue or roadmap? – DavidG Dec 16 '16 at 00:56
  • You can find the list of supported frameworks here https://msdn.microsoft.com/en-us/library/mt147923.aspx – Nikhil Vithlani - Microsoft Dec 16 '16 at 01:14
  • Thanks very much for the answer, is support planned? Can you possibly give any indication of whether it is a 1.X feature or later? – Brian Dec 16 '16 at 01:40
  • Hi Brian, It is on our roadmap, we don't have a timeline for it yet. – Nikhil Vithlani - Microsoft Dec 16 '16 at 17:52
  • 2
    I'm also with Brian here. Have built everything using .NET Core and now really the only missing piece is getting AE to work. Would really love to use AE instead of incorporating a custom version. Any updates to this roadmap? Maybe an alpha version to test out with .NET core? ;-) – Los Morales Jan 06 '17 at 17:31
  • 1
    Has there been any progress on the .NET Core framework regarding Always Encrypted? – phhbr Apr 11 '17 at 10:39
  • 3
    A status update would be appreciated. Or a link to the roadmap or issue in github. – Adam Jun 07 '17 at 17:44
  • I followed the ticket trail to this new ticket that's tracking the current state of the feature: https://github.com/aspnet/EntityFrameworkCore/issues/9193 – Frank Sep 26 '17 at 17:31
  • This is now supported, see my answer on this stackoverflow question : https://stackoverflow.com/questions/41027953/sql-server-always-encrypted-with-net-core-not-compatible?noredirect=1&lq=1 – Tim Bijnens Mar 03 '20 at 11:08
2

Always Encrypted is now supported in the .NET Core 3.0 Preview 5 through the new Microsoft.Data.SqlClient data provider for Microsoft SQL Server.

SoftDev
  • 1,084
  • 9
  • 13
  • 1
    yup - but I can't find any samples re: how to implement Always Encrypted using this new package. Does any one have any idea how to use it? – ossentoo Jun 27 '19 at 19:45
1

As mentioned by MS folks - Always Encrypted is currently not supported on .Net Core.

  • We had the same situation, finally we had to make the Core WebApp to target .NET Full Framework, there is no other option.

  • i.e., Currently not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1) Compatible with net452 (.NETFramework,Version=v4.5.2)

  • From forums - "Eventhough EF Core could work for AE feature, but still the underlying .NET Core SQL Client currently does not support for AE, and it will be in their (MS + Opensource ontributors) future mile stone to support it"

Please refer this GitHub page for any recent updates on this issue:

se7vanj
  • 160
  • 2
  • 8
  • 1
    Had same situation so we created a new project in the solution that targeted .NET46. Thought that would work but your MVC Web App also has to target .NET46. – John81 Nov 22 '17 at 22:05
1

It just mention here

Microsoft.data.sqlclient

Daleman
  • 794
  • 8
  • 23
1

As of .net Core 3.1 this is supported. I have it running in production scenario See my Answer on this stackoverflow question (Using EFCore and Azure KeyVault) : SQL Server Always Encrypted with .NET Core not compatible

Tim Bijnens
  • 310
  • 2
  • 11