I am trying to connect to SQL Server (on Azure VM) from Azure Databricks. I tried connecting using Python and Scala, but failed to connect.
I get the error:
The TCP/IP connection to the host HOSTNAME, port 1433 has failed.
I used the code in the following link: https://docs.databricks.com/data/data-sources/sql-databases.html
Both the SQL Server and the Databricks are on the same VNET.
I tried connecting to the SQL Server using "username" and "pwd" and I am able to connect from Management Studio on a Windows laptop.
val jdbcUrl = s"jdbc:sqlserver://${jdbcHostname}:${jdbcPort};database=${jdbcDatabase}"
I have the following details:
- Server Name - ABCD\EFGH (this is what I use to connect from Management Studio on Windows)
- IP Address
- I am using the default port 1433
- Fully qualified name - ABCD.lalaland.lala.lala.la
- Database name
- Username / pwd
What am I missing? What should the hostname be in JDBC URL? Should the instance name be included?