<?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: How can I connect to a SQL Mirror Database? in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4778318#M11297</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/798045"&gt;@abhidotnet&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope everything’s going smoothly on your end. We haven’t heard back from you, so I wanted to check if the issue got sorted. if you have any other issues please reach community.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jul 2025 09:38:12 GMT</pubDate>
    <dc:creator>v-priyankata</dc:creator>
    <dc:date>2025-07-28T09:38:12Z</dc:date>
    <item>
      <title>How can I connect to a SQL Mirror Database?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4763896#M10938</link>
      <description>&lt;P&gt;I’m working in a workspace in Microsoft Fabric where I’ve set up a notebook intended to connect to a SQL Mirror Database hosted in the same Fabric environment. However, when I try using the “Connect to Source” option in the notebook, the database doesn’t appear in the list—only Lakehouses from other workspaces show up.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Is there a recommended way to connect a Spark notebook to a SQL Mirror Database in Fabric?&lt;/STRONG&gt;&lt;BR /&gt;Am I missing a configuration step, or is there a specific connection string or method I should use manually?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Appreciate any guidance or examples from those who’ve set this up successfully!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2025 14:58:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4763896#M10938</guid>
      <dc:creator>abhidotnet</dc:creator>
      <dc:date>2025-07-15T14:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to a SQL Mirror Database?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4764302#M10939</link>
      <description>&lt;P&gt;This may not be a real solution to your issue, but WHY do you want to connect a Notebook to a Mirrored SQL database? Typically, you use Notebooks to collect and process non-tabular data sources (Excel, JSON, XML, etc.) and from there dump it into tabular destinations (read: tables).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If data is ALREADY in tables in the mirrored database, why not use T-SQL to access and process it?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2025 20:37:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4764302#M10939</guid>
      <dc:creator>ToddChitt</dc:creator>
      <dc:date>2025-07-15T20:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to a SQL Mirror Database?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4766510#M10986</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/798045"&gt;@abhidotnet&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to the Microsoft Fabric Forum Community.&lt;BR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/270"&gt;@ToddChitt&lt;/a&gt;&amp;nbsp;Thanks for your valuable inputs.&lt;BR /&gt;It's also a good idea to consider suggestions from the user, we can try that. adding another point below.&lt;BR /&gt;&lt;BR /&gt;The connect to data option in fabric notebooks only shows Lakehouse &amp;amp; KQL databases, we are not able see SQL Mirrored Databases listed there, even if your in the same workspace. To work around this, we can create a Lakehouse and adding a One Lake shortcut that points to the mirrored SQL database. please refer below document.&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/database/mirrored-database/explore-onelake-shortcut" target="_blank" rel="noopener"&gt;Explore Data in Your Mirrored Database With Notebooks - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Please feel free to reach out here if you need further assistance.&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 08:04:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4766510#M10986</guid>
      <dc:creator>v-priyankata</dc:creator>
      <dc:date>2025-07-17T08:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to a SQL Mirror Database?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4768196#M11034</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/798045"&gt;@abhidotnet&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rather than writing programming code like python or scala in notebook, you should use UI/ UX in Dataflow Gen 2 and use Mirrored SQL Database. ( Click, Click and Click and you are done..)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BhaveshPatel_0-1752831226878.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1284307iF5F0E0FE44184859/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BhaveshPatel_0-1752831226878.png" alt="BhaveshPatel_0-1752831226878.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BhaveshPatel_1-1752831685577.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1284310i1A8C219AFF04A3BE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BhaveshPatel_1-1752831685577.png" alt="BhaveshPatel_1-1752831685577.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jul 2025 09:44:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4768196#M11034</guid>
      <dc:creator>BhaveshPatel</dc:creator>
      <dc:date>2025-07-18T09:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to a SQL Mirror Database?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4768954#M11058</link>
      <description>&lt;P&gt;because you can do things more easily and in a saner way in Python than with the antedeluvian 4GL language that SQL is.&amp;nbsp; That would be my reason #1.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#2 you got a bunch of libs in Python to do data science and data engineering that do not exist in the SQL world.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and on and on it goes.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jul 2025 20:59:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4768954#M11058</guid>
      <dc:creator>Element115</dc:creator>
      <dc:date>2025-07-18T20:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to a SQL Mirror Database?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4768955#M11059</link>
      <description>&lt;P&gt;careful though with DFg2 as it is a lot more expensive in terms of CUs than doing the same with either SQL script or PySpark Notebook in a pipeline.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jul 2025 21:01:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4768955#M11059</guid>
      <dc:creator>Element115</dc:creator>
      <dc:date>2025-07-18T21:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to a SQL Mirror Database?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4771129#M11120</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/798045"&gt;@abhidotnet&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope the information provided was helpful. If you still have questions, please don't hesitate to reach out to the community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jul 2025 15:34:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4771129#M11120</guid>
      <dc:creator>v-priyankata</dc:creator>
      <dc:date>2025-07-21T15:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to a SQL Mirror Database?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4775398#M11214</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/798045"&gt;@abhidotnet&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to check if you had the opportunity to review the information provided by all. Please feel free to contact us if you have any further questions.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2025 16:33:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4775398#M11214</guid>
      <dc:creator>v-priyankata</dc:creator>
      <dc:date>2025-07-24T16:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to a SQL Mirror Database?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4778318#M11297</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/798045"&gt;@abhidotnet&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope everything’s going smoothly on your end. We haven’t heard back from you, so I wanted to check if the issue got sorted. if you have any other issues please reach community.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 09:38:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4778318#M11297</guid>
      <dc:creator>v-priyankata</dc:creator>
      <dc:date>2025-07-28T09:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to a SQL Mirror Database?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4796306#M11722</link>
      <description>&lt;P&gt;I was on vacation. I am going to explore this option of creating a lakehouse and a shortcut.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 20:08:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4796306#M11722</guid>
      <dc:creator>abhidotnet</dc:creator>
      <dc:date>2025-08-13T20:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to a SQL Mirror Database?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4796312#M11723</link>
      <description>&lt;P&gt;I require to create a report, dump it in a formatted excel file and send that file over to Azure Blob Storage. I understand there are a number of ways to skin this cat, but there are existing libraries in python that do this pretty easily. I want to leverage the code we already have and use it.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 20:14:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4796312#M11723</guid>
      <dc:creator>abhidotnet</dc:creator>
      <dc:date>2025-08-13T20:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to a SQL Mirror Database?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4796314#M11724</link>
      <description>&lt;P&gt;The information was helpful. There is one caveat: the shortcut to the mirror does not&lt;STRONG&gt; list the views&lt;/STRONG&gt; created in the mirror. I can probably work around the views, but I also have a separate request that involves firing a stored procedure.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 20:15:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4796314#M11724</guid>
      <dc:creator>abhidotnet</dc:creator>
      <dc:date>2025-08-13T20:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to a SQL Mirror Database?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4796431#M11728</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/798045"&gt;@abhidotnet&lt;/a&gt;&amp;nbsp;If you need to use a notebook with your mirrored SQL database there is a way. I cannot tell you if it's a recommended way, but it works.&lt;/P&gt;&lt;P&gt;First, you need a Lakehouse that you will use with your notebook. In that Lakehouse you create a shortcut to your mirrored SQL database and choose your mirror from &lt;STRONG&gt;Internal sources/OneLake&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;When your shortcut is created it will appear under &lt;STRONG&gt;Files/[Shortcut name]&lt;/STRONG&gt; in the Lakehouse and you would see all tables you picked for your shortcut presented as delta tables.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="apturlov_0-1755133705681.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1291087i43BB63BBD0DDDF24/image-size/medium?v=v2&amp;amp;px=400" role="button" title="apturlov_0-1755133705681.png" alt="apturlov_0-1755133705681.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now you can go to your notebook and load tables from the shortcut into a dataframe using delta format:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="apturlov_1-1755133849107.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1291088i53E256897AB0B21E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="apturlov_1-1755133849107.png" alt="apturlov_1-1755133849107.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2025 01:13:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4796431#M11728</guid>
      <dc:creator>apturlov</dc:creator>
      <dc:date>2025-08-14T01:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can I connect to a SQL Mirror Database?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4824830#M12315</link>
      <description>&lt;P&gt;I have solved this issue by creating a User data function. This process is explained here in Microsoft Documentation.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-engineering/user-data-functions/python-programming-model" target="_blank"&gt;Python programming model for Fabric User data functions (Preview) - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;This allows me to make the connection and fetch query results. I am able to get views as well as tables.&lt;BR /&gt;As of now, I haven't figured out how to do the stored procedure execution and that is next in line.&lt;BR /&gt;&lt;BR /&gt;my function looks like this --&amp;gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;import pandas as pd
import fabric.functions as fn

udf = fn.UserDataFunctions()

# Select 'Manage connections' and add a connection to a Fabric SQL Database 
# Replace the alias "&amp;lt;alias for sql database&amp;gt;" with your connection alias.
@udf.connection(argName="sqlDB",alias="MYMIRRORDATABASE")
@udf.function()
def read_from_sql_db(sqlDB: fn.FabricSqlConnection, query: str)-&amp;gt; pd.DataFrame:
    '''
    Description: Read data from Mirror DATABASE using input query.
    
    Args:
        sqlDB (fn.FabricSqlConnection): Fabric SQL database connection.
    
    Returns:
        DataFrame query result.

    '''

    # Establish a connection to the SQL database
    connection = sqlDB.connect()

    df = pd.read_sql(query, connection)
    print(df.head())
    return df;
&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Sep 2025 20:06:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-can-I-connect-to-a-SQL-Mirror-Database/m-p/4824830#M12315</guid>
      <dc:creator>abhidotnet</dc:creator>
      <dc:date>2025-09-12T20:06:44Z</dc:date>
    </item>
  </channel>
</rss>

