Copy Data from sql Server to Synapse

Wajih Arfaoui 70 Reputation points
2024-01-08T10:45:10.9766667+00:00

I am trying to copy data from Azure SQL Server to Synapse via Data Factory, during the process, Azure Blob will be used as a staging layer. The problem is that the client is asking for the roles to assign to my user account and he is against giving admin access to the whole Storage account. Is there a way to bypass this ? Thank you

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,415 questions
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,239 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,491 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,345 questions
{count} votes

Accepted answer
  1. Bhargava-MSFT 31,216 Reputation points Microsoft Employee
    2024-01-08T21:53:59.2666667+00:00

    Hello Wajih Arfaoui,

    Welcome to the Microsoft Q&A forum.

    You don't need to have admin access on the Azure blob(staging layer).

    If your linked servie(staging linked service) is using managed identity(which is similar to using your own service principal) authentication then you need to grant "storage blob data contributor" permissions to your synapse/adf workspace managed identity in your staging Azure Blob Storage or Azure Data Lake Storage Gen2 account.

    Please follow this document to grant perissions to workspace managed identity.

    How staged copy works: https://learn.microsoft.com/en-us/azure/data-factory/copy-activity-performance-features#how-staged-copy-works

    Per the document, you need to grant delete permission to your Azure Data Factory in your staging storage, so that the temporary data can be cleaned after the copy activity runs.

    "Storage blob data contributor" or "storage blob data owner" roles have delete permissions.

    Note:

    If your staging Azure Storage is configured with VNet service endpoint, you must use managed identity authentication with "allow trusted Microsoft service" enabled on storage account, refer to Impact of using VNet Service Endpoints with Azure storage.

    If your staging Azure Storage is configured with Managed Private Endpoint and has the storage firewall enabled, you must use managed identity authentication and grant Storage Blob Data Reader permissions to the Synapse SQL Server to ensure it can access the staged files during the PolyBase load.

    I hope this answers your question. Please let me know if you have any further questions.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Wajih Arfaoui 70 Reputation points
    2024-01-23T12:00:13.1933333+00:00

    following on that process, I am trying to copy a table from SQL Server to Synapse and i keep getting this error: ErrorCode=PolybaseOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Error happened when loading data into SQL Data Warehouse. Operation: 'Polybase operation'.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Data.SqlClient.SqlException,Message=Conversion failed when converting from a character string to uniqueidentifier.,Source=.Net SqlClient Data Provider,SqlErrorNumber=8169,Class=16,ErrorCode=-2146232060,State=2,Errors=[{Class=16,Number=8169,State=2,Message=Conversion failed when converting from a character string to uniqueidentifier.,},],' while i made sure to create a table in Synapse with the same columns type as the original table.

    0 comments No comments

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.