diff --git a/README.md b/README.md index 841562d..662900f 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ To download all sample notebooks, [here](notebooks/connect_storage.dbc) is the D | | |AD Passthrough|**User has correct RBAC role assigned OR ACLs permissions to files/folders in ADLS Gen2|[Python](notebooks/directconnect_adpassthrough_py.py), [SQL](notebooks/directconnect_adpassthrough_sql.sql)| [ADLS Gen2](https://docs.azuredatabricks.net/spark/latest/data-sources/azure/azure-datalake-gen2.html#access-adls-automatically-with-your-aad-credentials)| |**Mount on DBFS**|Databricks Workspace|Storage Key|All rights|[Python](notebooks/mount_storagekey_py.py)|[Blob](https://docs.azuredatabricks.net/spark/latest/data-sources/azure/azure-storage.html#mount-azure-blob-storage-containers-with-dbfs), [ADLS Gen2](https://docs.azuredatabricks.net/spark/latest/data-sources/azure/azure-datalake-gen2.html#access-an-adls-account-directly-using-the-storage-account-access-key)| | | |OAuth via Service Principal (SP)|**SP has correct RBAC role assigned OR ACLs permissions to files/folders in ADLS Gen2|[Python](notebooks/mount_oauthsp_py.py)| [ADLS Gen2](https://docs.azuredatabricks.net/spark/latest/data-sources/azure/azure-datalake-gen2.html#mount-an-adls-filesystem-to-dbfs-using-a-service-principal-and-oauth-2-0)| +| | |AD Passthrough|**User has correct RBAC role assigned OR ACLs permissions to files/folders in ADLS Gen2|[Python](notebooks/mount_adpassthrough_py.py)|[ADLS Gen2](https://docs.azuredatabricks.net/spark/latest/data-sources/azure/adls-passthrough.html#mount-your-data-with-dbfs)| |---|---|---|---|---|---| diff --git a/notebooks/connect_storage.dbc b/notebooks/connect_storage.dbc index cc2001f..85855bd 100644 Binary files a/notebooks/connect_storage.dbc and b/notebooks/connect_storage.dbc differ diff --git a/notebooks/mount_adpassthrough_py.py b/notebooks/mount_adpassthrough_py.py new file mode 100644 index 0000000..f885ea2 --- /dev/null +++ b/notebooks/mount_adpassthrough_py.py @@ -0,0 +1,21 @@ +# Databricks notebook source +# MAGIC %md +# MAGIC ## Azure DataLake Gen2 +# MAGIC +# MAGIC 1. Azure Databricks Premium Plan. +# MAGIC 2. Azure Data Lake Storage Gen2: Databricks Runtime 5.3 or above. +# MAGIC 3. High concurrency clusters, which support only Python and SQL. [Enabled AD Passthrough checkbox under Advanced Options](https://docs.azuredatabricks.net/spark/latest/data-sources/azure/adls-passthrough.html#enable-passthrough-for-a-cluster) +# MAGIC 4. User needs to have [Storage Data Blob Owner/Contributor/Reader role](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-portal#rbac-roles-for-blobs-and-queues) OR [appropriate ACL permissions (R/W/E) on ADLA Gen2](https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-access-control#access-control-lists-on-files-and-directories) is granted + +# COMMAND ---------- + +configs = { + "fs.azure.account.auth.type": "CustomAccessToken", + "fs.azure.account.custom.token.provider.class": spark.conf.get("spark.databricks.passthrough.adls.gen2.tokenProviderClassName") +} + +# Optionally, you can add to the source URI of your mount point. +dbutils.fs.mount( + source = "abfss://@.dfs.core.windows.net/", + mount_point = "/mnt/my_adls_gen2_mount_path/", + extra_configs = configs) \ No newline at end of file