<?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 to create a Unity Catalog Connection to SQL Server using service principal?? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-create-a-unity-catalog-connection-to-sql-server-using/m-p/140933#M51583</link>
    <description>&lt;P&gt;Awesome! That worked perfectly! I really appreciate your help - you saved me a bunch of time. Thank you!&lt;/P&gt;</description>
    <pubDate>Tue, 02 Dec 2025 21:38:31 GMT</pubDate>
    <dc:creator>ScottH</dc:creator>
    <dc:date>2025-12-02T21:38:31Z</dc:date>
    <item>
      <title>How to create a Unity Catalog Connection to SQL Server using service principal??</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-create-a-unity-catalog-connection-to-sql-server-using/m-p/140924#M51578</link>
      <description>&lt;P&gt;I am trying to use the Databricks Python SDK (v 0.63.0) to create a Unity Catalog connection to a Azure-hosted SQL Server database using an Azure service principal to authenticate. I have successfully done this via the Workspace UI, but I am trying to replicate programmatically it using the Databricks Python SDK.&lt;/P&gt;&lt;P&gt;Below is the code that I am trying to use to create the connection, but it doesn't authenticate successfully. The login to SQL Server fails when I try to create a foreign catalog using the connection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;# Authenticate to workspace&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;w &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;WorkspaceClient&lt;/SPAN&gt;&lt;SPAN&gt;(...&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;db_host = "&amp;lt;SQL Server host&amp;gt;"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;db_port&lt;/SPAN&gt;&lt;SPAN&gt;: "1433"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;db_user = "&amp;lt;service principal client ID"&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;db_password =&amp;nbsp;"&amp;lt;service principal client secret"&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;# Create the connection using the ConnectionsAPI&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;connection &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; w.connections.&lt;/SPAN&gt;&lt;SPAN&gt;create&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;connection_name,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;connection_type&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;ConnectionType.SQLSERVER,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;comment&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;connection_comment,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;options&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"host"&lt;/SPAN&gt;&lt;SPAN&gt;: db_host,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"port"&lt;/SPAN&gt;&lt;SPAN&gt;: db_port,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"user"&lt;/SPAN&gt;&lt;SPAN&gt;: db_user, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"password"&lt;/SPAN&gt;&lt;SPAN&gt;: db_password,&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"applicationIntent"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"ReadOnly"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"trustServerCertificate"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"true"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; },&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I'm thinking that I am missing something that indicates that the credentials are a service principal and not a local SQL Server user. What am I missing? I don't see how to do this in the Python SDK documentation.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 02 Dec 2025 20:06:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-create-a-unity-catalog-connection-to-sql-server-using/m-p/140924#M51578</guid>
      <dc:creator>ScottH</dc:creator>
      <dc:date>2025-12-02T20:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Unity Catalog Connection to SQL Server using service principal??</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-create-a-unity-catalog-connection-to-sql-server-using/m-p/140925#M51579</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/181727"&gt;@ScottH&lt;/a&gt;&amp;nbsp;Can you please try this in options.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;options={
        "host": "&amp;lt;sql-server-host&amp;gt;.database.windows.net",
        "port": "1433",
        "authentication": "ActiveDirectoryServicePrincipal",
        "client_id": "&amp;lt;service-principal-client-id&amp;gt;",
        "client_secret": "&amp;lt;service-principal-client-secret&amp;gt;",
        "tenant_id": "&amp;lt;azure-ad-tenant-id&amp;gt;",
        "applicationIntent": "ReadOnly",
        "trustServerCertificate": "true"
    }&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 02 Dec 2025 20:34:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-create-a-unity-catalog-connection-to-sql-server-using/m-p/140925#M51579</guid>
      <dc:creator>nayan_wylde</dc:creator>
      <dc:date>2025-12-02T20:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Unity Catalog Connection to SQL Server using service principal??</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-create-a-unity-catalog-connection-to-sql-server-using/m-p/140930#M51582</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/181727"&gt;@ScottH&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You need to configure it in following way (I've tested it and it works). In a place where a red arrow is pointing you need to provide your own tenant_id:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="szymon_dybczak_0-1764710136658.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/22057i879488535553168D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="szymon_dybczak_0-1764710136658.png" alt="szymon_dybczak_0-1764710136658.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2025 21:29:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-create-a-unity-catalog-connection-to-sql-server-using/m-p/140930#M51582</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2025-12-02T21:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Unity Catalog Connection to SQL Server using service principal??</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-create-a-unity-catalog-connection-to-sql-server-using/m-p/140933#M51583</link>
      <description>&lt;P&gt;Awesome! That worked perfectly! I really appreciate your help - you saved me a bunch of time. Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2025 21:38:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-create-a-unity-catalog-connection-to-sql-server-using/m-p/140933#M51583</guid>
      <dc:creator>ScottH</dc:creator>
      <dc:date>2025-12-02T21:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Unity Catalog Connection to SQL Server using service principal??</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-create-a-unity-catalog-connection-to-sql-server-using/m-p/140934#M51584</link>
      <description>&lt;P&gt;No problem&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/181727"&gt;@ScottH&lt;/a&gt;&amp;nbsp;, cool that it worked for you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2025 21:40:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-create-a-unity-catalog-connection-to-sql-server-using/m-p/140934#M51584</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2025-12-02T21:40:47Z</dc:date>
    </item>
  </channel>
</rss>

