Connect to Fabric SQL DB from Fabric notebook using pyspark
Hello Team,
I have a requirement to establish the connection to Fabric SQL DB from Fabric notebook using pyspark code.
below are the steps I have tried,
  1. created a Fabric SQL DB (SQLDB1609), Schema (SalesLT), table (Address)
  2. created a notebook and trying below code snippet
# Define connection properties
server_name = "6vkyftw2r2xedcsd52kjo4bpjq-s343udatgcyebnur2gormglqku.database.fabric.microsoft.com,1433"
database_name = "SQLDB1609-e46bc349-4c85-43ae-87b8-08f6793bc4f9"
# JDBC URL
jdbc_url = f"jdbc:sqlserver://{server_name}:1433;databaseName={database_name};encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;"
I am not able to establish the connection, can someone help me with the different approaches to "connect to Fabric SQL DB from fabric notebook using pyspark code".
2
17 comments
Venkat Karudumpa
3
Connect to Fabric SQL DB from Fabric notebook using pyspark
Learn Microsoft Fabric
skool.com/microsoft-fabric
Helping passionate analysts, data engineers, data scientists (& more) to advance their careers on the Microsoft Fabric platform.
Leaderboard (30-day)
Powered by