<?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 i can add ADLS Gen2 - OAuth 2.0 as Cluster scope for my High concurrency Shared Cluster (without unity catalog)? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13744#M8368</link>
    <description>&lt;P&gt;Yes, the approach to set it in the spark config you used is correct and according to best practices. Additionally, you can put it in cluster policy so it will be for all clusters.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jan 2023 11:42:35 GMT</pubDate>
    <dc:creator>Hubert-Dudek</dc:creator>
    <dc:date>2023-01-05T11:42:35Z</dc:date>
    <item>
      <title>How i can add ADLS Gen2 - OAuth 2.0 as Cluster scope for my High concurrency Shared Cluster (without unity catalog)?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13738#M8362</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help me , how i can add the ADLS gen2 OAuth 2.0 authentication to my high concurrency shared cluster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/919iFD2E805D6C7CA770/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to scope this authentication to entire cluster not for particular notebook.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently i have added them as spark configuration of the cluster , by keeping my service principal credentials as  Secrets. But still am getting this following warning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/926iF1ACC797D69BDC12/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly advice me what's the better alternate secure solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Am creating the cluster using Terraform&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sunil&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 13:22:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13738#M8362</guid>
      <dc:creator>sunil_smile</dc:creator>
      <dc:date>2023-01-04T13:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: How i can add ADLS Gen2 - OAuth 2.0 as Cluster scope for my High concurrency Shared Cluster (without unity catalog)?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13739#M8363</link>
      <description>&lt;P&gt;It looks like you've removed some config entries from Spark Config that are required for multi-user cluster to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to only add the required config rather than overwriting.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 13:33:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13739#M8363</guid>
      <dc:creator>daniel_sahal</dc:creator>
      <dc:date>2023-01-04T13:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: How i can add ADLS Gen2 - OAuth 2.0 as Cluster scope for my High concurrency Shared Cluster (without unity catalog)?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13740#M8364</link>
      <description>&lt;P&gt;Thanks for the response @Daniel Sahal​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But that's not an issue , i have enabled the Access mode as Shared by setting this property for my highly concurrent cluster and its working&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/920i84CBB7775BBDB7D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;. &lt;/P&gt;&lt;P&gt;ADLS gen2 OAuth is also working. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But my question , is it secured or any other better option where i can store the Cluster level scope&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 15:19:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13740#M8364</guid>
      <dc:creator>sunil_smile</dc:creator>
      <dc:date>2023-01-04T15:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: How i can add ADLS Gen2 - OAuth 2.0 as Cluster scope for my High concurrency Shared Cluster (without unity catalog)?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13741#M8365</link>
      <description>&lt;P&gt;Have you considered using session scopes instead of cluster scopes? I have a function stored at databricks. functions. azure. py that does this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;from pyspark.sql import SparkSession
&amp;nbsp;
def set_session_scope(scope: str, client_id: str, client_secret: str, tenant_id: str, storage_account_name: str, container_name: str) -&amp;gt; str:
    
    """Connects to azure key vault, authenticates, and sets spark session to use specified service principal for read/write to adls
    
    Args:
        scope: The azure key vault scope name
        client_id: The key name of the secret for the client id
        client_secret: The key name of the secret for the client secret
        tenant_id: The key name of the secret for the tenant id
        storage_account_name: The name of the storage account resource to read/write from
        container_name: The name of the container resource in the storage account to read/write from
&amp;nbsp;
    Returns:
        Spark configs get set appropriately
        abfs_path (string): The abfss:// path to the storage account and container
    """
&amp;nbsp;
    spark = SparkSession.builder.getOrCreate()
&amp;nbsp;
    try:
        from pyspark.dbutils import DBUtils
        dbutils = DBUtils(spark)
    except ImportError:
        import IPython
        dbutils = IPython.get_ipython().user_ns["dbutils"]
&amp;nbsp;
    client_id = dbutils.secrets.get(scope = scope, key = client_id)
    client_secret = dbutils.secrets.get(scope = scope, key = client_secret)
    tenant_id = dbutils.secrets.get(scope = scope, key = tenant_id)
&amp;nbsp;
    spark.conf.set(f"fs.azure.account.auth.type.{storage_account_name}.dfs.core.windows.net", "OAuth")
    spark.conf.set(f"fs.azure.account.oauth.provider.type.{storage_account_name}.dfs.core.windows.net", "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider")
    spark.conf.set(f"fs.azure.account.oauth2.client.id.{storage_account_name}.dfs.core.windows.net", client_id)
    spark.conf.set(f"fs.azure.account.oauth2.client.secret.{storage_account_name}.dfs.core.windows.net", client_secret)
    spark.conf.set(f"fs.azure.account.oauth2.client.endpoint.{storage_account_name}.dfs.core.windows.net", f"https://login.microsoftonline.com/{tenant_id}/oauth2/token")
    
    abfs_path = "abfss://" + container_name + "@" + storage_account_name + ".dfs.core.windows.net/"
    
    return abfs_path&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And its usage is like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;from databricks.functions.azure import set_session_scope
# Set session scope and connect to abfss to read source data
&amp;nbsp;
client_id = "databricks-serviceprincipal-id"
client_secret = "databricks-serviceprincipal-secret"
tenant_id = "tenant-id"
storage_account_name = "your-storage-account-name"
container_name = "your-container-name"
folder_path = "" #path/to/folder/
&amp;nbsp;
abfs_path = set_session_scope(
    scope = scope,
    client_id = client_id, 
    client_secret = client_secret, 
    tenant_id = tenant_id, 
    storage_account_name = storage_account_name, 
    container_name = container_name 
)
&amp;nbsp;
file_list = dbutils.fs.ls(abfs_path + folder_path)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 21:44:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13741#M8365</guid>
      <dc:creator>Jfoxyyc</dc:creator>
      <dc:date>2023-01-04T21:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: How i can add ADLS Gen2 - OAuth 2.0 as Cluster scope for my High concurrency Shared Cluster (without unity catalog)?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13742#M8366</link>
      <description>&lt;UL&gt;&lt;LI&gt;error is because of missing default settings (create new cluster and do not remove them),&lt;/LI&gt;&lt;LI&gt;the warning is because secrets should be put in secret scope, and then you should reference secrets in settings&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 05 Jan 2023 09:29:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13742#M8366</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2023-01-05T09:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: How i can add ADLS Gen2 - OAuth 2.0 as Cluster scope for my High concurrency Shared Cluster (without unity catalog)?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13743#M8367</link>
      <description>&lt;P&gt;Thanks for the response. But in this case every time we have to execute this function right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am expecting something similar to Mount point (unfortunately -Databricks not recommends mount point for ADLS) , where at the time of cluster creation itself we will provide connection to our storage account.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 11:25:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13743#M8367</guid>
      <dc:creator>sunil_smile</dc:creator>
      <dc:date>2023-01-05T11:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: How i can add ADLS Gen2 - OAuth 2.0 as Cluster scope for my High concurrency Shared Cluster (without unity catalog)?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13744#M8368</link>
      <description>&lt;P&gt;Yes, the approach to set it in the spark config you used is correct and according to best practices. Additionally, you can put it in cluster policy so it will be for all clusters.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 11:42:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13744#M8368</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2023-01-05T11:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: How i can add ADLS Gen2 - OAuth 2.0 as Cluster scope for my High concurrency Shared Cluster (without unity catalog)?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13745#M8369</link>
      <description>&lt;P&gt;thanks hubert... could you kindly guide , how i can add that in the cluster policy ?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 12:49:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13745#M8369</guid>
      <dc:creator>sunil_smile</dc:creator>
      <dc:date>2023-01-05T12:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: How i can add ADLS Gen2 - OAuth 2.0 as Cluster scope for my High concurrency Shared Cluster (without unity catalog)?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13747#M8371</link>
      <description>&lt;P&gt;Yes , i have configured them in spark configuration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i am yet to configure in cluster policy as he recommended&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 18:06:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-i-can-add-adls-gen2-oauth-2-0-as-cluster-scope-for-my-high/m-p/13747#M8371</guid>
      <dc:creator>sunil_smile</dc:creator>
      <dc:date>2023-01-12T18:06:11Z</dc:date>
    </item>
  </channel>
</rss>

