Synapse Dedicated SQL pool issue

Pavankumar-3526 306 Reputation points
2023-02-11T02:54:02.21+00:00

I created a SQL user and granted control privileges to the user and was able to perform the DML operations via SSMS.

but when I use the linked service with that user, I am not able to perform any DML operations via dataflow. I am getting this error.

Here is the script I am using.

on master

CREATE LOGIN [test] WITH PASSWORD=N'xxxxxx'

CREATE USER test FROM LOGIN test

on testDB

CREATE USER test FROM LOGIN test

on testDB

Grant control on schema::dbo to test;

Synapse error from the pipeline when I tried to perform the DML operations.

Operation on target Data flow1 failed: {"StatusCode":"DFExecutorUserError","Message":"Job failed due to reason: at Sink 'sink1': User does not have permission to perform this action.\r\nChanged database context to 'testdb'.","Details":"shaded.msdataflow.com.microsoft.sqlserver.jdbc.SQLServerException: User does not have permission to perform this action.\r\nChanged database context to 'testdb'.\n\tat shaded.msdataflow.com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:265)\n\tat

but I can able to execute DML operations from SSMS or datastudio with the same sql login.

The issue is happening only when I use the synapse or adf pipelines.

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,373 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
{count} votes

2 answers

Sort by: Most helpful
  1. HimanshuSinha-msft 19,486 Reputation points Microsoft Employee Moderator
    2023-02-15T21:29:21.36+00:00

    Hello @Pavankumar-3526 :

    I think I have a repro and this only happens when you have AutoCreate table option is set in the copy activity.

    Error

    ErrorCode=SqlOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=A database operation failed with the following error: 'User does not have permission to perform this action. Changed database context to 'synapse'.',Source=,''Type=System.Data.SqlClient.SqlException,Message=User does not have permission to perform this action. Changed database context to 'DBAName'.,Source=.Net SqlClient Data Provider,SqlErrorNumber=6004,Class=14,ErrorCode=-2146232060,State=9,Errors=[{Class=14,Number=6004,State=9,Message=User does not have permission to perform this action. Changed database context to 'synapse'.,},],'
    

    User's image

    Solution is to provide the User (in your case test) the required permission.

    GRANT CREATE TABLE TO test
    User's image

    Let me know how its goes

    Thanks

    Himanshu
    Please accept the answer if you think it helped you .

    1 person found this answer helpful.

  2. Vinodh247 34,661 Reputation points MVP Volunteer Moderator
    2023-02-11T11:12:50.6233333+00:00

    Hi

    Thanks for reaching out to Microsoft Q&A.

    Clearly looks like a permission issue reading at the error message. What role does the login has in the database? that you are using in the linked service?

    Please Upvote and Accept as answer if the reply was helpful, this will be helpful to other community members.


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.