<?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 S60 Eliminate SPN secrets - Connect Azure Databricks to ADLS Gen2 , Gen1 via custom AD token in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/s60-eliminate-spn-secrets-connect-azure-databricks-to-adls-gen2/m-p/72950#M7457</link>
    <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Hi Team,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;In Azure Databricks, we currently use Service Principal when creating Mount Points to Azure storage ( ADLS Gen1, ADLS Gen 2 and Azure Blob Storage).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;As part of S360 action to eliminate SPN secrets, we were asked to move to SPN+certificate / MSI/ User Assigned Managed Identity.&lt;/P&gt;&lt;P&gt;We tried connecting using a custom Active directory (AD) token rather than a client secret through databricks. PEM certificate was used to generate the custom AD token through Java code. We tried to pass the AD token via OAUTH2 method setting below spark configuration.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%scala&lt;/P&gt;&lt;P&gt;// Set up Spark configurations for ADLS Gen2 access with Azure AD token&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;spark.conf.set("fs.azure.account.auth.type.&amp;lt;Your storage Account&amp;gt;.dfs.core.windows.net", "OAuth")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;spark.conf.set("fs.azure.account.oauth.provider.type.&amp;lt;Your storage Account&amp;gt;.dfs.core.windows.net", "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;spark.conf.set("fs.azure.account.oauth2.client.id.&amp;lt;Your storage Account&amp;gt;.dfs.core.windows.net", "clientid")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;spark.conf.set("fs.azure.account.oauth2.client.secret.&amp;lt;Your storage Account&amp;gt;.dfs.core.windows.net", "")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;spark.conf.set("fs.azure.account.oauth2.client.endpoint.&amp;lt;Your storage Account&amp;gt;.dfs.core.windows.net",&lt;A href="https://login.microsoftonline.com/%3cTenanant-Id%3e/oauth2/v2.0/token" target="_blank" rel="noopener"&gt;https://login.microsoftonline.com/&amp;lt;Tenanant-Id&amp;gt;/oauth2/v2.0/token&lt;/A&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;spark.conf.set("fs.azure.account.oauth2.access.token.provider", access_token)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;To link to an ADLS Gen 2 storage account and access files, we are encountering the following issue.&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;SPAN&gt;Please refer the attachment to attach error screenshot&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If you come across similar issue would you be able to help?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 12 Jun 2024 19:38:06 GMT</pubDate>
    <dc:creator>rameshkumar610</dc:creator>
    <dc:date>2024-06-12T19:38:06Z</dc:date>
    <item>
      <title>S60 Eliminate SPN secrets - Connect Azure Databricks to ADLS Gen2 , Gen1 via custom AD token</title>
      <link>https://community.databricks.com/t5/get-started-discussions/s60-eliminate-spn-secrets-connect-azure-databricks-to-adls-gen2/m-p/72950#M7457</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Hi Team,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;In Azure Databricks, we currently use Service Principal when creating Mount Points to Azure storage ( ADLS Gen1, ADLS Gen 2 and Azure Blob Storage).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;As part of S360 action to eliminate SPN secrets, we were asked to move to SPN+certificate / MSI/ User Assigned Managed Identity.&lt;/P&gt;&lt;P&gt;We tried connecting using a custom Active directory (AD) token rather than a client secret through databricks. PEM certificate was used to generate the custom AD token through Java code. We tried to pass the AD token via OAUTH2 method setting below spark configuration.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%scala&lt;/P&gt;&lt;P&gt;// Set up Spark configurations for ADLS Gen2 access with Azure AD token&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;spark.conf.set("fs.azure.account.auth.type.&amp;lt;Your storage Account&amp;gt;.dfs.core.windows.net", "OAuth")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;spark.conf.set("fs.azure.account.oauth.provider.type.&amp;lt;Your storage Account&amp;gt;.dfs.core.windows.net", "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;spark.conf.set("fs.azure.account.oauth2.client.id.&amp;lt;Your storage Account&amp;gt;.dfs.core.windows.net", "clientid")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;spark.conf.set("fs.azure.account.oauth2.client.secret.&amp;lt;Your storage Account&amp;gt;.dfs.core.windows.net", "")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;spark.conf.set("fs.azure.account.oauth2.client.endpoint.&amp;lt;Your storage Account&amp;gt;.dfs.core.windows.net",&lt;A href="https://login.microsoftonline.com/%3cTenanant-Id%3e/oauth2/v2.0/token" target="_blank" rel="noopener"&gt;https://login.microsoftonline.com/&amp;lt;Tenanant-Id&amp;gt;/oauth2/v2.0/token&lt;/A&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;spark.conf.set("fs.azure.account.oauth2.access.token.provider", access_token)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;To link to an ADLS Gen 2 storage account and access files, we are encountering the following issue.&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;SPAN&gt;Please refer the attachment to attach error screenshot&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If you come across similar issue would you be able to help?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Jun 2024 19:38:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/s60-eliminate-spn-secrets-connect-azure-databricks-to-adls-gen2/m-p/72950#M7457</guid>
      <dc:creator>rameshkumar610</dc:creator>
      <dc:date>2024-06-12T19:38:06Z</dc:date>
    </item>
  </channel>
</rss>

