<?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: Using Python + StreamLit to connect to a Fabric SQL database/lakehouse in Data Science</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4851299#M892</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1249533" data-lia-user-login="v-sdhruv" class="lia-mention lia-mention-user"&gt;v-sdhruv&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1365487" data-lia-user-login="chapperscobbler" class="lia-mention lia-mention-user"&gt;chapperscobbler&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;In order to connect to SQL database in fabric using Python/streamlit you can follow this latest article which describes in detail how to connect to a SQL database.&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/database/sql/connect-python?tabs=alpine-linux" target="_blank" rel="noopener"&gt;Connect to a SQL database in Fabric with the Microsoft Python Driver for SQL Server - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;One of the reasons why you are facing authentication issue could be due to improper configuration of&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Azure AD App Registration (for authentication)&lt;/LI&gt;&lt;LI&gt;Python environment with required packages&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Ensure your app registration has API permissions for Microsoft Fabric and SQL.&lt;BR /&gt;For authentication using Python, make sure to install proper packages and then authenticate.&lt;BR /&gt;Also, refer -&amp;nbsp;&lt;A href="https://devblogs.microsoft.com/azure-sql/build-a-streamlit-application-with-fabric-sql-database/" target="_blank" rel="noopener"&gt;Build a Streamlit application with Fabric SQL Database - Azure SQL Devs’ Corner&lt;/A&gt;-&lt;A href="https://slopegamerun.com/" target="_blank"&gt;Slope Game&lt;/A&gt;&amp;nbsp;If you would like to share the error details and your code it would be great since it will help to point&amp;nbsp; out the issue better.&lt;BR /&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Okay, let's untangle this authentication knot! Is your Azure AD App Registration feeling lost? Perhaps Python's missing a crucial piece of its puzzle? Hmm, API permissions, a common culprit indeed. Remember that time my smart fridge wouldn't connect to the Wi-Fi? Turns out, I hadn't granted it network access.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Oct 2025 04:22:19 GMT</pubDate>
    <dc:creator>EfrainNelso</dc:creator>
    <dc:date>2025-10-16T04:22:19Z</dc:date>
    <item>
      <title>Using Python + StreamLit to connect to a Fabric SQL database/lakehouse</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4840026#M881</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone setup a Python Streamlit App, to run locally on their laptop, and connect to a MS Fabric database ?&amp;nbsp; Looking to do this as POC, as we may be looking to utilise Streamlit further in future with Fabric.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having issues connecting / authentication / getting token etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried a number of ways, within my python code to get a token/credentials from the Fabric database that we have set up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Initial errors were stating i am missing tenant_id, client_id, token_file_path ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone offer up some advice about how to do this, with python/streamlit ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Oct 2025 14:29:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4840026#M881</guid>
      <dc:creator>chapperscobbler</dc:creator>
      <dc:date>2025-10-01T14:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python + StreamLit to connect to a Fabric SQL database/lakehouse</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4840571#M883</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1365487" data-lia-user-login="chapperscobbler" class="lia-mention lia-mention-user"&gt;chapperscobbler&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;In order to connect to SQL database in fabric using Python/streamlit you can follow this latest article which describes in detail how to connect to a SQL database.&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/database/sql/connect-python?tabs=alpine-linux" target="_blank"&gt;Connect to a SQL database in Fabric with the Microsoft Python Driver for SQL Server - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;One of the reasons why you are facing authentication issue could be due to improper configuration of&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Azure AD App Registration (for authentication)&lt;/LI&gt;
&lt;LI&gt;Python environment with required packages&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Ensure your app registration has API permissions for Microsoft Fabric and SQL.&lt;BR /&gt;For authentication using Python, make sure to install proper packages and then authenticate.&lt;BR /&gt;Also, refer -&amp;nbsp;&lt;A href="https://devblogs.microsoft.com/azure-sql/build-a-streamlit-application-with-fabric-sql-database/" target="_blank"&gt;Build a Streamlit application with Fabric SQL Database - Azure SQL Devs’ Corner&lt;/A&gt;&lt;BR /&gt;If you would like to share the error details and your code it would be great since it will help to point out the issue better.&lt;BR /&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Oct 2025 10:51:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4840571#M883</guid>
      <dc:creator>v-sdhruv</dc:creator>
      <dc:date>2025-10-02T10:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python + StreamLit to connect to a Fabric SQL database/lakehouse</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4841887#M884</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1365487" data-lia-user-login="chapperscobbler" class="lia-mention lia-mention-user"&gt;chapperscobbler&lt;/a&gt;&amp;nbsp;&lt;!--   StartFragment    --&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Yes, you can connect a Python + Streamlit app to a Microsoft Fabric SQL database using ODBC and pyodbc, but authentication must be handled via Azure AD with either a user identity or service principal. The key is configuring your connection string and token acquisition correctly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Steps to Connect Streamlit to Fabric SQL Database&lt;/P&gt;&lt;P&gt;1. &lt;STRONG&gt;Prerequisites&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Fabric workspace with SQL database or Lakehouse (with SQL endpoint enabled)&lt;/LI&gt;&lt;LI&gt;Azure AD tenant with access to the Fabric workspace&lt;/LI&gt;&lt;LI&gt;Python, Streamlit, and ODBC driver installed locally&lt;/LI&gt;&lt;LI&gt;Service Principal or user credentials with appropriate permissions&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Authentication Options&lt;/P&gt;&lt;P&gt;Option A: &lt;STRONG&gt;User Identity (Interactive Login)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Use Azure Identity libraries to acquire a token interactively:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from azure.identity import InteractiveBrowserCredential import pyodbc credential = InteractiveBrowserCredential() token = credential.get_token("&lt;A href="https://database.windows.net/.default" target="_blank" rel="noopener"&gt;https://database.windows.net/.default&lt;/A&gt;").token conn_str = ( "Driver={ODBC Driver 18 for SQL Server};" "Server=tcp:.database.windows.net;" "Database=;" "Authentication=ActiveDirectoryAccessToken;" ) conn = pyodbc.connect(conn_str, attrs_before={1256: token})&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Option B: &lt;STRONG&gt;Service Principal (Recommended for Production)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Use ClientSecretCredential to authenticate with a service principal:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from azure.identity import ClientSecretCredential import pyodbc tenant_id = "" client_id = "" client_secret = "" credential = ClientSecretCredential(tenant_id, client_id, client_secret) token = credential.get_token("&lt;A href="https://database.windows.net/.default" target="_blank" rel="noopener"&gt;https://database.windows.net/.default&lt;/A&gt;").token conn_str = ( "Driver={ODBC Driver 18 for SQL Server};" "Server=tcp:.database.windows.net;" "Database=;" "Authentication=ActiveDirectoryAccessToken;" ) conn = pyodbc.connect(conn_str, attrs_before={1256: token})&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Streamlit Integration&lt;/P&gt;&lt;P&gt;Once connected, you can use Pandas to query and display data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import pandas as pd import streamlit as st query = "SELECT TOP 10 * FROM SalesLT.Product" df = pd.read_sql(query, conn) st.dataframe(df)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Troubleshooting Tips&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Ensure the &lt;STRONG&gt;ODBC Driver 18 for SQL Server&lt;/STRONG&gt; is installed.&lt;/LI&gt;&lt;LI&gt;Your Fabric SQL endpoint must be accessible externally (check firewall settings).&lt;/LI&gt;&lt;LI&gt;If using service principal, it must have &lt;STRONG&gt;Viewer or higher access&lt;/STRONG&gt; to the Fabric workspace.&lt;/LI&gt;&lt;LI&gt;Store secrets securely using .streamlit/secrets.toml or environment variables.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;!--   EndFragment    --&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Oct 2025 18:44:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4841887#M884</guid>
      <dc:creator>anilgavhane</dc:creator>
      <dc:date>2025-10-03T18:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python + StreamLit to connect to a Fabric SQL database/lakehouse</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4843126#M886</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1365487" data-lia-user-login="chapperscobbler" class="lia-mention lia-mention-user"&gt;chapperscobbler&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;&lt;BR /&gt;I hope the explaination provided helped you to resolve the issue.&lt;BR /&gt;&lt;I&gt;If you still need any help, feel free to reach out to us.&lt;BR /&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;&lt;I&gt;Thanks for reaching out on Microsoft Fabric community forum.&lt;BR /&gt;&lt;BR /&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2025 10:15:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4843126#M886</guid>
      <dc:creator>v-sdhruv</dc:creator>
      <dc:date>2025-10-06T10:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python + StreamLit to connect to a Fabric SQL database/lakehouse</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4843755#M887</link>
      <description>&lt;P&gt;Yes, you can add Python/Streamlit in Fabric. Can you provide more details about your poc to make recommendations?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2025 18:20:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4843755#M887</guid>
      <dc:creator>amysy1</dc:creator>
      <dc:date>2025-10-06T18:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python + StreamLit to connect to a Fabric SQL database/lakehouse</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4846624#M888</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1365487" target="_blank"&gt;@chapperscobbler&lt;/A&gt;&amp;nbsp;,&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;&lt;BR /&gt;I hope the explaination provided helped you to resolve the issue.&lt;BR /&gt;If you still need any help, feel free to reach out to us.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Thanks for reaching out on Microsoft Fabric community forum.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 11:30:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4846624#M888</guid>
      <dc:creator>v-sdhruv</dc:creator>
      <dc:date>2025-10-09T11:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python + StreamLit to connect to a Fabric SQL database/lakehouse</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4848787#M889</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1249533" data-lia-user-login="v-sdhruv" class="lia-mention lia-mention-user"&gt;v-sdhruv&lt;/a&gt;&amp;nbsp; , yes thanks for your help, have now connected to Fabric via Streamlit.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2025 09:38:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4848787#M889</guid>
      <dc:creator>chapperscobbler</dc:creator>
      <dc:date>2025-10-13T09:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python + StreamLit to connect to a Fabric SQL database/lakehouse</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4851299#M892</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1249533" data-lia-user-login="v-sdhruv" class="lia-mention lia-mention-user"&gt;v-sdhruv&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1365487" data-lia-user-login="chapperscobbler" class="lia-mention lia-mention-user"&gt;chapperscobbler&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;In order to connect to SQL database in fabric using Python/streamlit you can follow this latest article which describes in detail how to connect to a SQL database.&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/database/sql/connect-python?tabs=alpine-linux" target="_blank" rel="noopener"&gt;Connect to a SQL database in Fabric with the Microsoft Python Driver for SQL Server - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;One of the reasons why you are facing authentication issue could be due to improper configuration of&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Azure AD App Registration (for authentication)&lt;/LI&gt;&lt;LI&gt;Python environment with required packages&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Ensure your app registration has API permissions for Microsoft Fabric and SQL.&lt;BR /&gt;For authentication using Python, make sure to install proper packages and then authenticate.&lt;BR /&gt;Also, refer -&amp;nbsp;&lt;A href="https://devblogs.microsoft.com/azure-sql/build-a-streamlit-application-with-fabric-sql-database/" target="_blank" rel="noopener"&gt;Build a Streamlit application with Fabric SQL Database - Azure SQL Devs’ Corner&lt;/A&gt;-&lt;A href="https://slopegamerun.com/" target="_blank"&gt;Slope Game&lt;/A&gt;&amp;nbsp;If you would like to share the error details and your code it would be great since it will help to point&amp;nbsp; out the issue better.&lt;BR /&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Okay, let's untangle this authentication knot! Is your Azure AD App Registration feeling lost? Perhaps Python's missing a crucial piece of its puzzle? Hmm, API permissions, a common culprit indeed. Remember that time my smart fridge wouldn't connect to the Wi-Fi? Turns out, I hadn't granted it network access.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 04:22:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Using-Python-StreamLit-to-connect-to-a-Fabric-SQL-database/m-p/4851299#M892</guid>
      <dc:creator>EfrainNelso</dc:creator>
      <dc:date>2025-10-16T04:22:19Z</dc:date>
    </item>
  </channel>
</rss>

