I've configured delegation for SQL server engine and SSRS and it works fine.
SQL Server (2017) engine and SSRS installd on the same machine. Let's call it SqlSrv1.
What we should attain to: User opens a report with a dataset which joins a database data and an external shared file (with sensitive data) via impersonation. If user has no access to a shared file, report should display him an empty sensitive columns.
- When I execute
BULK INSERT
via SSMS, something like
BULK INSERT #t1 FROM '\\FS1\common\anyfile.txt'
it works fine. Computer Management shows my name (instead of sqlengine service account) in "Shared folders\Sessions" as User and SqlSrv1 as Computer.
Now when I execute
BULK INSERT
from SSRS report dataset against a local file (stored on SqlSrv1C:\anyfile.txt
) it works and ProcMon displays my name in Detail column, instead of ssrs service account.At last I execute BULK INSERT from SSRS report dataset against a shared file
\\FS1\common\anyfile.txt
and I get errorOperating system error 5(Access is denied.)
, but ProcMon displays my name in Detail column as Impersonating.
There is a something strange I've located:
When I change Data Source in connection string of dataset to FQDN
, BULK INSERT
begones to work from SSRS. After that I change back Data Source to NetBIOS
but BULK INSERT
continues to work. What is going on?
All fine and dandy, but after restart SSRS service I get error Operating system error 5(Access is denied.)
again.
When I execute the query from the step 1, ProcMon shows me the path
\\FS1\common\\anyfile.txt
(with double slash after shared folder name! What?!!)
instead of
\\FS1\common\anyfile.txt
When I get error 5, ProcMon shows
\\FS1\common\anyfile.txt
(without double slash)
But when the step 3 begones to work (after FQDN
manipulations), OMG! The ProcMon shows me
\\FS1\common\\anyfile.txt
(with double slash)
and after SSRS service restart I see in ProcMon
\\FS1\common\anyfile.txt
(without double slash)
I've tryed to add double slash to BULK INSERT
, but with no luck, SQL engine drops it (as expected).
Have you any ideas?
BULK INSERT
an SSRS dataset and a File together? Also a little unclear if you're saying you're trying toBULK INSERT
into an SSRS dataset, in conjunction with one, or from one, as I see no mention of the SSRS report or dataset at all?