Hi Balaji M [C] ,
Welcome to Microsoft Q&A platform and thanks for posting your query here.
It seems that you are facing firewall related issue while trying to establish connection between pyspark notebook and SQL server instance.
The error message "make sure tcp/ip connections are not blocked by a firewall" indicates that there may be a firewall blocking the TCP/IP connection between your PySpark application and the SQL Server database.
- Check the firewall settings: Make sure that the firewall settings on the SQL Server machine allow incoming connections on the TCP/IP port used by the SQL Server instance. You can check the firewall settings in the Windows Firewall with Advanced Security tool.
- Check the SQL Server configuration: Make sure that the SQL Server instance is configured to allow remote connections. You can check the SQL Server configuration in the SQL Server Configuration Manager tool.
- Check the connection string: Make sure that the connection string used in your PySpark application is correct and includes the correct TCP/IP port number. You can also try specifying the IP address of the SQL Server machine instead of the hostname in the connection string.
Hope it helps. Kindly let us know how it goes. Thankyou