So I played a little with this. If I first verified that delegation worked for a linked server. That is, I was running SSMS on server A, connected to server B and ran a linked-server query against server C. That worked. Then I tried to run BULK INSERT against a file on a share on server C. That did not work, but I got the same error as Michelle.
Out of curiosity, I asked around "Is this supposed to work?", and I got this answer from a contact at Microsoft:
Yeah, this is expected, it’s really more about Kerberos delegation for file shares than anything specific to BULK INSERT.
What’s happening is the classic double-hop: you connect from A to B, and then B tries to access C on your behalf. Whether that works depends on which services on C are allowed for delegation.
In your setup, B is talking to two different services on C:
- SQL Server (via the linked server)
- The file share (via SMB for BULK INSERT)
Delegation is already set up for SQL Server on C, which is why the SELECT works. The file share isn’t included, so when BULK INSERT tries to open the file as you, it gets denied.
To change it, you just need to update delegation on the SQL Server service account on B and add the file service for C. You should end up with both:
- MSSQLSvc/C.fqdn:1433 (or your instance/port)
- cifs/C.fqdn (or HOST/C.fqdn)
A couple things to keep in mind:
- Constrained delegation still respects the user’s permissions on C.
- If A -> B isn’t already using Kerberos, you may need “Use any authentication protocol.”
- Make sure the user isn’t marked as “sensitive and cannot be delegated.”
The behavior should be the same independent of SQL version.
Yeah, this is expected, it’s really more about Kerberos delegation for file shares than anything specific to BULK INSERT.
What’s happening is the classic double-hop: you connect from A to B, and then B tries to access C on your behalf. Whether that works depends on which services on C are allowed for delegation.
In your setup, B is talking to two different services on C:
- SQL Server (via the linked server)
- The file share (via SMB for BULK INSERT)
Delegation is already set up for SQL Server on C, which is why the SELECT works. The file share isn’t included, so when BULK INSERT tries to open the file as you, it gets denied.
To change it, you just need to update delegation on the SQL Server service account on B and add the file service for C. You should end up with both:
- MSSQLSvc/C.fqdn:1433 (or your instance/port)
- cifs/C.fqdn (or HOST/C.fqdn)
A couple things to keep in mind:
- Constrained delegation still respects the user’s permissions on C.
- If A -> B isn’t already using Kerberos, you may need “Use any authentication protocol.”
- Make sure the user isn’t marked as “sensitive and cannot be delegated.”
The behavior should be the same independent of SQL version.
I understand from your original post that you have more or less tried this already, but maybe you have missed something somewhere.
No, I did not try this myself. I don't know if I have the rights to play with delegation, but even if I have it is definitely outside the scope from what I am supposed to do on these servers. (I'm not a DBA; but a systems developer.) However, my gut feeling is that, yes, you can do this with BULK INSERT if you configure everything correctly. The reason I think so is that I expect this to be a common thing that people want to do. So if it does not work at all, I would expect to see more questions about it.
I hope you have followed our advice to open a support case, and maybe the issue is already resolved by now. But I still wanted to make this update.