Azure / data-api-builder

Data API builder provides modern REST and GraphQL endpoints to your Azure Databases and on-prem stores.
https://aka.ms/dab/docs
MIT License
949 stars 197 forks source link

Support for Azure SQL Always Encrypted #2444

Open SupportBXTR opened 3 weeks ago

SupportBXTR commented 3 weeks ago

Can't find a reference in the documentation so posting the question here:

Does Data API Builder have support Azure SQL Always Encrypted?

I am running a test environment using the following connection string: Server=tcp:blabla.database.windows.net,1433;Initial Catalog=blabla; Persist Security Info=False;User ID=blabla;Password=blabla;MultipleActiveResultSets=False; Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;Column Encryption Setting=enabled;

Get request: https://{{host}}/api/HRAntwoorden

Returns an error 500, the most descriptive error in the logs of the container: Azure.DataApiBuilder.Core.Resolvers.IQueryExecutor[0] 0f284a15-472f-4cbf-b7a5-e9b060f08c9b Query execution error due to: 'FOR JSON' clause is unsupported for encrypted columns. Microsoft.Data.SqlClient.SqlException (0x80131904): 'FOR JSON' clause is unsupported for encrypted columns.

Environment details:

The setup is working from SSMS using the following tutorial: https://medium.com/codex/advanced-database-encryption-with-sql-server-always-encrypted-2962e468d2ab

There seems to be some support for Always Encrypted, but DAB fails because it appends FOR JSON to the end of the SQL Query. Am I missing something? Thx in advance