Forum Discussion

PowerNewUser's avatar
PowerNewUser
Resolver I
2 years ago

Dataflow gen2 ends in sucess but does not refresh the data on table with security policy

I have a lakehouse secured using a security policy that controls the access by the user email. When I run the dataflow gen2 to refresh the tables, it runs successfully but the data is not updated.

The dataflow is setup to replace the table. I have found even deleting the table in the lake house does not work until the policy is first removed. When I remove the policy and refresh the dataflow - it works just fine. Any suggestions on how to refresh my data while keeping the policy in place?

----SECURITY POLICY SQL USED

CREATE FUNCTION Security.tvf_supervisorEmailPredicate(@Email AS varchar(150))
    RETURNS TABLE
    WITH SCHEMABINDING
    AS
    RETURN SELECT 1 AS tvf_supervisorEmailPredicate_result
WHERE @Email = USER_NAME();
GO
CREATE SECURITY POLICY Security.Active_SupervisorFilter
    ADD FILTER PREDICATE Security.tvf_supervisorEmailPredicate(Supervisor_Email)
    ON dbo.<tablename>
    WITH (STATE = ON);
GO


1 Reply