TCP IP CONNECTION O THE HOST PORT HAS FAILED

Abhishek Gaikwad 191 Reputation points
2021-03-10T09:43:16.24+00:00

I am trying to connect to Azure SQL database on PAAS environment. This is required to write data from Databricks to azure SQL database and also read data from Azure SQL database.
When i run the connection string and try to connect to a table present in SQL database using datbricks get the below error message. Do i need to open ports on SQL server database side and also how databricks can read data from SQL database. Are their any reference articles.

Error message : SQL server Exception : The TCP/IP connection to the host port has failed. Verify the connection properties.. Make sure that the instance of SQL server is running on the host and accepting TCP/IP connnectionss at the port . Make sure that the TCP connecstions to the port are not blocked by a firewall.

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
1,916 questions
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA-MSFT 76,921 Reputation points Microsoft Employee
    2021-03-10T11:06:35.76+00:00

    Hello @Abhishek Gaikwad ,

    Can you ensure that you have the Allow connections from Azure services enabled on both the Azure Databricks instance and the Azure SQL database instance? It is likely that this is not enabled for the Azure SQL Database and thus the connection fails.

    This article covers how to use the DataFrame API to connect to SQL databases using JDBC and how to control the parallelism of reads through the JDBC interface.

    Step1: Establish connectivity to SQL Server

    76270-image.png

    Step2: Check connectivity and red & write from/to JDBC.

    76304-image.png

    Hope this helps. Do let us know if you any further queries.

    ------------

    Please don’t forget to Accept Answer and Up-Vote wherever the information provided helps you, this can be beneficial to other community members.


0 additional answers

Sort by: Most helpful