As of EF Core 2.1, Always Encrypted SQL Server feature is not yet supported.
I am using both SQL Server 2016 and Azure SQL and all clients are Windows-based.
Do not role your own implementation. What we ended up doing was creating a separate Windows Classic Desktop class library project in our solution that handled the data layer for the table with encrypted columns. We used Dapper for the ORM in that project and it supported the encrypted columns. It really limited some things we could do since the rest of our data layer was through EF Core but it works.
Since you are using Azure SQL, I would also recommend using the Microsoft Azure Key Vault to store the column master key. See the NuGet package Microsoft.SqlServer.Management.AlwaysEncrypted.AzureKeyVaultProvider. This NuGet package is also not supported in .NET Core.
This is now supported on .Net Core 3.1, on Lower versions you will have a harder time implmenting it, also see my answer about implementing it on .Net Core 3.1 here: SQL Server Always Encrypted with .NET Core not compatible
See this github issue/comment https://github.com/dotnet/SqlClient/issues/11#issuecomment-520100830
To clarify : Microsoft.Data.SqlClient should be used on .Net Core 3.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With