user1651818
user1651818

Reputation: 31

Connecting Azure Synapse from Azure Databricks using User Assigned Managed Identity

Unable to connect to Azure Synapse from Azure Databricks - Notebook (PySpark) using JDBC, Using teh following JDBC url, getting exception:

jdbc:sqlserver://.sql.azuresynapse.net;database=;User Id=Authentication=ActiveDirectoryMSI;Use Encryption for Data=true;

Exception:

Caused by: java.lang.IllegalArgumentException: No JDBC credentials provided. You must specify JDBC credentials in either the URL or as user/password options, use Credential Passthrough, or set Service Principal Oauth2.0 authentication.

Code:

df.write \
      .format("com.databricks.spark.sqldw") \
      .option("url", "jdbc:sqlserver://<synapse server name>.sql.azuresynapse.net;database=<dedicated pool name>;User Id=<UserAssignedManageIdentity>Authentication=ActiveDirectoryMSI;Use Encryption for Data=true; 
") \
      .option("useAzureMSI","true") \
      .option("dbtable", "table_name") \
      .option("truncate","false") \
      .option("tempDir", "abfss://<azure_storage_name>@<container_name>.dfs.core.windows.net/tempDir") \
      .mode("overwrite") \
      .save()

What is the correct connection string to connect to Synapse using User Managed Service Identity.

Background:

Upvotes: 1

Views: 581

Answers (1)

Alex Ott
Alex Ott

Reputation: 87174

There is no support for managed identity on Azure Databricks clusters (yet). So you need to use other authentication methods.

Upvotes: 0

Related Questions