Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Jothy
Regular Visitor

Notebook - Data Sources

Hi Team,

From Fabric Notebook, we can see the possible data sources as Lakehouse alone. So can it have only Lakehouse as data source and no other sources like RDBMS or anyother sources/targets apart from lakehouse?

1 ACCEPTED SOLUTION
APG
Frequent Visitor

In Fabric notebooks you are not limited to Lakehouses: actually you can write your own code to connect to other RDBMS; for example you can write a code snippet that connects to MySQL using jdbc

View solution in original post

2 REPLIES 2
v-huijiey-msft
Community Support
Community Support

Hi @Jothy ,

 

Thanks for the reply from @APG .

 

Fabric Notebooks primarily supports data sources from Lakehouse, but it is not limited to them.

 

You can also connect to other data sources, including relational databases (RDBMS) and a variety of cloud and local sources.

 

The following is an example of connecting to an Azure SQL database using basic authentication:

# Placeholders for Azure SQL Database connection info
server_name = "<your_server_name>.database.windows.net"
database_name = "<your_database_name>"
table_name = "<YourTableName>"
db_username = "<username>"
db_password = "<password>"

# Build the Azure SQL Database JDBC URL
jdbc_url = f"jdbc:sqlserver://{server_name}:1433;database={database_name};encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;"

# Properties for the JDBC connection
properties = {
    "user": db_username, 
    "password": db_password,  
    "driver": "com.microsoft.sqlserver.jdbc.SQLServerDriver",
}

# Read entire table from Azure SQL Database using Basic authentication
sql_df = spark.read.jdbc(url=jdbc_url, table=table_name, properties=properties)

# Show the Azure SQL DataFrame
sql_df.show()

 

Please see below for specific steps:

Connect to data with Spark - Training | Microsoft Learn

 

You may also want to check out this CASE that has similar needs to yours.

Solved: JDBC connection to Fabric Lakehouse SQL endpoint u... - Microsoft Fabric Community

 

If you have any other questions please feel free to contact me.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

APG
Frequent Visitor

In Fabric notebooks you are not limited to Lakehouses: actually you can write your own code to connect to other RDBMS; for example you can write a code snippet that connects to MySQL using jdbc

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.