How can we write data to Azure synapse dedicated sql pool from Azure Databricks using a Service principal?

440 views Asked by At

I am trying to use below code to write the data to synapse dedicated sql pool table.

The Data is stored in ADLS Gen2 and I am trying to write a dataframe into a sql table

I also have a service principal created for Azure Databricks that I am also using in Synapse as db_owner,

enter image description here

While running the code - I get below error:

java.lang.IllegalArgumentException: Could not retrieve Credential Passthrough token. Please check if Credential Passthrough is enabled

Can some please help explain what is wrong here because my cluster shows passthrough enabled enter image description here

1

There are 1 answers

2
Naveen Sharma On

I got same error when I tried in my environment.

enter image description here

You can see here, I have not enabled the credential passthrough for the cluster and still got the error.

enter image description here

To resolve this error, make sure you have the correct permissions as mentioned in this documentation.

And also, you can try with two service principals one for the storage account another for the synapse workspace. Add these in the databricks ini script as mentioned in this documentation.