<?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 Managed Identity Authentication in Unity Catalog using pyodbc in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/using-managed-identity-authentication-in-unity-catalog-using/m-p/99696#M40061</link>
    <description>&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;I have spent an enormous amount of hours fighting with this and in the end it was the type of cluster... I hope that this problem will be solved in the future, because affects the developments when you use databricks-connect and share the cluster with your team &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Nov 2024 18:05:23 GMT</pubDate>
    <dc:creator>mbenavent</dc:creator>
    <dc:date>2024-11-21T18:05:23Z</dc:date>
    <item>
      <title>Using Managed Identity Authentication in Unity Catalog using pyodbc</title>
      <link>https://community.databricks.com/t5/data-engineering/using-managed-identity-authentication-in-unity-catalog-using/m-p/82567#M36685</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am having trouble using Managed Identity Authentication in Unity Catalog using pyodbc in Azure Databricks. The same code works on a "Legacy Shared Compute". The code snippet is below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;import pyodbc&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;jdbc_url = (&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; "DRIVER={ODBC 17 DRIVER PATH};"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; "SERVER=AzureSQLServer.database.windows.net,1433;"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; "DATABASE=AzureSQLDBName;"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; "Authentication=ActiveDirectoryMsi;"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; "TrustServerCertificate=no;"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; "Encrypt=yes")&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;conn = pyodbc.connect(jdbc_url)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If I run this on a "Shared Compute" enabled for Unity Catalog, I get a connection timeout error:&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;('HYT00', '[HYT00] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0) (SQLDriverConnect)')&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;If I switch to using UID/PWD, then it works on the Unity Catalog as well. So, not sure why Managed Identity would not work on a Unity Catalog enabled cluster but work on the Legacy cluster.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any thoughts would be appreciated.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;Rushi&lt;/DIV&gt;</description>
      <pubDate>Fri, 09 Aug 2024 14:00:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/using-managed-identity-authentication-in-unity-catalog-using/m-p/82567#M36685</guid>
      <dc:creator>rushi29</dc:creator>
      <dc:date>2024-08-09T14:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using Managed Identity Authentication in Unity Catalog using pyodbc</title>
      <link>https://community.databricks.com/t5/data-engineering/using-managed-identity-authentication-in-unity-catalog-using/m-p/82597#M36700</link>
      <description>&lt;P&gt;I wanted to provide an update on this issue and see if the added information can help resolve the problem. So, after doing some research, it turns out that the Unity Catalog cluster is unable to reach the Azure Instance Metadata Service (IMDS) possibly due to some network restrictions for unity catalog enabled clusters. This prevents the cluster from getting an access token that is needed to use Managed Identity. I used curl to hit the IMDS endpoint and it errors out in case of Unity Catalog.&lt;/P&gt;&lt;P&gt;%sh&lt;/P&gt;&lt;P&gt;curl -H Metadata:true &lt;A href="http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&amp;amp;resource=https://database.windows.net/" target="_blank"&gt;http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&amp;amp;resource=https://database.windows.net/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rushi29_0-1723239930607.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/10282i815EE79EEF76DC84/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="rushi29_0-1723239930607.png" alt="rushi29_0-1723239930607.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have raised this with our Databricks administrators but in order to help them out, does anyone know where these networking settings might be for Unity Catalog where this IP/port can be whitelisted?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rushi&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 21:50:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/using-managed-identity-authentication-in-unity-catalog-using/m-p/82597#M36700</guid>
      <dc:creator>rushi29</dc:creator>
      <dc:date>2024-08-09T21:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using Managed Identity Authentication in Unity Catalog using pyodbc</title>
      <link>https://community.databricks.com/t5/data-engineering/using-managed-identity-authentication-in-unity-catalog-using/m-p/99696#M40061</link>
      <description>&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;I have spent an enormous amount of hours fighting with this and in the end it was the type of cluster... I hope that this problem will be solved in the future, because affects the developments when you use databricks-connect and share the cluster with your team &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 18:05:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/using-managed-identity-authentication-in-unity-catalog-using/m-p/99696#M40061</guid>
      <dc:creator>mbenavent</dc:creator>
      <dc:date>2024-11-21T18:05:23Z</dc:date>
    </item>
  </channel>
</rss>

