启用 Unity Catalog 后无法使用或列出 databricks 中的挂载点

问题描述 投票:0回答:1

我有一个 databricks 工作区,在其中安装了我的 azure 存储容器,但在启用 Unity 目录后,我无法使用 dbutils.fs.ls('/mnt/') 列出安装点,除非我拥有管理员访问权限。

我有多个使用 adf 自动执行的脚本,所以现在我无法将安装点更改为卷

我尝试了以下代码来列出挂载点,但抛出以下异常:

dbutils.fs.ls('/mnt/') 

ExecutionError:调用 o438.ls 时发生错误。 org.apache.spark.SparkSecurityException:[INSUFFICIENT_PERMISSIONS]权限不足: 用户没有任何文件的 SELECT 权限。 SQL状态:42501 在 com.databricks.sql.acl.Unauthorized.throwInsufficientPermission

azure databricks azure-storage databricks-unity-catalog data-engineering
1个回答
0
投票

错误:

ExecutionError:调用 o438.ls 时发生错误。 org.apache.spark.SparkSecurityException:[INSUFFICIENT_PERMISSIONS] 权限不足:用户没有对任何文件的 SELECT 权限。 SQLSTATE:42501位于com.databricks.sql.acl.Unauthorized.throwInsufficientPermission

上述错误消息表明您没有足够的权限。

要确保为您的用户帐户分配所需的角色,您可以按照以下步骤操作:

以下是我的挂载脚本:

configs={"fs.azure.account.auth.type":"OAuth",     "fs.azure.account.oauth.provider.type":"org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider",
         "fs.azure.account.oauth2.client.id":"<Your client ID>",  "fs.azure.account.oauth2.client.secret":dbutils.secrets.get(scope="<YOUR DATABRICKS SECRET SCOPE NAME >", key="<KEY VAULT SECRET NAME>"), "fs.azure.account.oauth2.client.endpoint":"https://login.microsoftonline.com/<Your tenant ID>/oauth2/token"}
dbutils.fs.mount(source= "abfss://[email protected]",
                 mount_point="/mnt/raw",
                 extra_configs=configs)

我已将

KEY VAULT Administrator
角色分配给 SPNAZUREDATABRICKS 应用程序。

enter image description here

我已将

Storage Blob Data Contributor
角色分配给 SPNAZUREDATABRICKS 应用程序。

enter image description here

结果:

dbutils.fs.ls('/mnt/raw/')
[FileInfo(path='dbfs:/mnt/raw/sample_employee_data.csv', name='sample_employee_data.csv', size=813, modificationTime=1729745074000)]
© www.soinside.com 2019 - 2024. All rights reserved.