I have made a Linux Docker container performing several tasks, and finally connecting to a SQL Server 2019 (v15), and executing BULK INSERT to load a local (to the SQL Server) .csv file. The connection is made using SQL Server authentication.
As I realized, this isn't possible, as opposed to Windows authenticated users who have access to said files, SQL Server authenticated users have the permissions of the SQL Server process account, which doesn't have access to said files.
Relevant documentation by Microsoft:
It is advised to grant those permissions to the SQL Server process account, but I am afraid this won't be possible in a corporate production setting.
Are you aware of any workarounds?
I tried impersonating a Windows user, but that won't work since in that scenario the original login security context is taken into account (ie the SQL Server login).
I am thinking of using DATABASE SCOPED CREDENTIALS and EXTERNAL SOURCE, but I am not entirely sure that this has any connection to my problem, and the documentation is mainly about cloud, not local storage.
The final solution I think will be through Active Directory and Kerberos (?) but be it that I am using containers I think that will be the hardest one.
Any thoughts and recommendations are welcome.
Thanks in advance.