I'm trying to connect to synapse serverless pool via databricks. I need to create synapse views and external tables directly in databricks as part of an existing pipeline. I know that i would be paying for databricks and synapse, but this is agreed by architecture.
I 've tried these credentials in SSMS and they work fine :
synapse_sql_username = 'databricks'
synapse_sql_password = 'TestPassword2345'
synapse_sql_server = "linkedvsnps98765BIproject-ondemand.sql.azuresynapse.net"
synapse_sql_database= "ServerlessTest"
synapse_sql_url = "jdbc:sqlserver://{SERVER_ADDR};databaseName={DATABASE_NAME};".format(SERVER_ADDR = synapse_sql_server,DATABASE_NAME = synapse_sql_database)
#for executing non-queries
sql_driver_manager = spark._sc._gateway.jvm.java.sql.DriverManager
sql_con = sql_driver_manager.getConnection(synapse_sql_url, synapse_sql_username, synapse_sql_password)
While this above piece of code works perfectly fine for dedicated pool. It does not seems to work for serverless pool :
com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open database "ServerlessTest" requested by the login. The login failed. ClientConnectionId:ddeffedce3-d7905724-440c-84ae-e892083297469c
Is it possible to connect to serverless sql pool via databricks ?
Any observation, suggestion or expertise would be much appreciated !
CodePudding user response:
As per the repro from my end, I'm able to run the above code without any issue: