<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Notebook - Data Sources in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Notebook-Data-Sources/m-p/4079896#M3442</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/766886"&gt;@Jothy&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply from &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/781271"&gt;@APG&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Fabric Notebooks primarily supports data sources from Lakehouse, but it is not limited to them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also connect to other data sources, including relational databases (RDBMS) and a variety of cloud and local sources.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following is an example of connecting to an Azure SQL database using basic authentication:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# Placeholders for Azure SQL Database connection info
server_name = "&amp;lt;your_server_name&amp;gt;.database.windows.net"
database_name = "&amp;lt;your_database_name&amp;gt;"
table_name = "&amp;lt;YourTableName&amp;gt;"
db_username = "&amp;lt;username&amp;gt;"
db_password = "&amp;lt;password&amp;gt;"

# 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()
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Please see below for specific steps:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-gb/training/modules/ingest-data-with-spark-fabric-notebooks/2-connect-authenticate" target="_blank"&gt;Connect to data with Spark - Training | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;You may also want to check out this CASE that has similar needs to yours.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/General-Discussion/JDBC-connection-to-Fabric-Lakehouse-SQL-endpoint-using-notebook/m-p/3750883" target="_blank"&gt;Solved: JDBC connection to Fabric Lakehouse SQL endpoint u... - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have any other questions please feel free to contact me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Aug 2024 05:42:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-08-05T05:42:14Z</dc:date>
    <item>
      <title>Notebook - Data Sources</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Notebook-Data-Sources/m-p/4075405#M3423</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 07:57:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Notebook-Data-Sources/m-p/4075405#M3423</guid>
      <dc:creator>Jothy</dc:creator>
      <dc:date>2024-08-02T07:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Notebook - Data Sources</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Notebook-Data-Sources/m-p/4075683#M3424</link>
      <description>&lt;P&gt;In Fabric notebooks you are not limited to&amp;nbsp;&lt;SPAN&gt;Lakehouses: actually you can write your own code to connect to other&amp;nbsp;RDBMS; for example you can write a code snippet that connects to&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;MySQL using jdbc&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 09:46:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Notebook-Data-Sources/m-p/4075683#M3424</guid>
      <dc:creator>APG</dc:creator>
      <dc:date>2024-08-02T09:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Notebook - Data Sources</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Notebook-Data-Sources/m-p/4079896#M3442</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/766886"&gt;@Jothy&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply from &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/781271"&gt;@APG&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Fabric Notebooks primarily supports data sources from Lakehouse, but it is not limited to them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also connect to other data sources, including relational databases (RDBMS) and a variety of cloud and local sources.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following is an example of connecting to an Azure SQL database using basic authentication:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# Placeholders for Azure SQL Database connection info
server_name = "&amp;lt;your_server_name&amp;gt;.database.windows.net"
database_name = "&amp;lt;your_database_name&amp;gt;"
table_name = "&amp;lt;YourTableName&amp;gt;"
db_username = "&amp;lt;username&amp;gt;"
db_password = "&amp;lt;password&amp;gt;"

# 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()
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Please see below for specific steps:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-gb/training/modules/ingest-data-with-spark-fabric-notebooks/2-connect-authenticate" target="_blank"&gt;Connect to data with Spark - Training | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;You may also want to check out this CASE that has similar needs to yours.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/General-Discussion/JDBC-connection-to-Fabric-Lakehouse-SQL-endpoint-using-notebook/m-p/3750883" target="_blank"&gt;Solved: JDBC connection to Fabric Lakehouse SQL endpoint u... - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have any other questions please feel free to contact me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 05:42:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Notebook-Data-Sources/m-p/4079896#M3442</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-05T05:42:14Z</dc:date>
    </item>
  </channel>
</rss>

