RLS on Serverless SQL Pool Views

Renato de Melo 125 Reputation points
2024-03-15T19:41:01.7433333+00:00

I want to apply RLS (row-level-security) into a Serverless SQL Pool View.

In this way I created a table value function to be applied in a view and when I tried to create a policy:

CREATE SECURITY POLICY <policy name>

ADD FILTER PREDICATE <table value function>

ON <view-name> ;

I got the following error:

"Cannot schema bind security policy '<policy-name>'. '<view-name>' is not schema bound."

Thus I dropped the view and tried to recreate it with option "WITH SCHEMABINDING":

"CREATE VIEW <view-name>

WITH SCHEMABINDING

AS

SELECT

<field-list>

FROM

OPENROWSET(

<openrowset details>

) as [data];"

But I also got an error:

"Remote access is not allowed from within a schema-bound object."

I followed the steps in this article:
https://learn.microsoft.com/en-us/sql/relational-databases/security/row-level-security?view=sql-server-ver16

I have two questions:

  1. Does RLS "Row-level-security" work with Synapse Serverless SQL Pool?
  2. Is "WITH SCHEMABINDING" supported by Synapse Serverless SQL Pool Views?

Thank you for any comments.

Regards

Renato de Melo

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,252 questions
{count} votes

Accepted answer
  1. VINODH KUMAR 30,346 Reputation points MVP
    2024-03-17T07:17:18.97+00:00

    Hi Renato de Melo,

    Thanks for reaching out to Microsoft Q&A.

    Does RLS "Row-level-security" work with Synapse Serverless SQL Pool?

    No. Currently RLS is only supported on Dedicated SQL Pool, not in Serverless SQL pool. You can try the workaround as below in order to implement RLS in serverless.

    https://techcommunity.microsoft.com/t5/azure-synapse-analytics-blog/how-to-implement-row-level-security-in-serverless-sql-pools/ba-p/2354759

    Is "WITH SCHEMABINDING" supported by Synapse Serverless SQL Pool Views?

    This feature is not supported in Serverless sql pools either.

    User's image

    https://learn.microsoft.com/en-us/sql/t-sql/statements/create-view-transact-sql?view=sql-server-ver16#schemabinding

    Please 'Upvote'(Thumbs-up) and 'Accept' as an answer if the reply was helpful. This will benefit other community members who face the same issue.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.