azure datalake gen2 databricks ACL 权限
azure datalake gen2 databricks ACLs permissions
我想了解为什么我的 ACL 权限在 Databricks 中无法正常工作。
场景:我有 2 个用户。一个对 FileSystem 和具有完全权限的人。其他没有任何权限。
我尝试使用两种不同的方法在数据块中安装 Gen2 文件系统。
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": clientid,
"fs.azure.account.oauth2.client.secret": credential,
"fs.azure.account.oauth2.client.endpoint": refresh_url}
dbutils.fs.mount(
source = "abfss://xyz@abc.dfs.core.windows.net/",
mount_point = "/mnt/xyz",
extra_configs = configs)
并使用直通
2.
configs = {
"fs.azure.account.auth.type": "CustomAccessToken",
"fs.azure.account.custom.token.provider.class": spark.conf.get("spark.databricks.passthrough.adls.gen2.tokenProviderClassName")
}
dbutils.fs.mount(
source = "abfss://xyz@abc.dfs.core.windows.net/",
mount_point = "/mnt/xyz",
extra_configs = configs)
两者都挂载文件系统。但是当我使用:
dbfs.fs.ls("/mnt/xyz")
它显示没有数据湖权限的用户的所有内容文件/文件夹。
如果有人能向我解释问题出在哪里,我会很高兴。
谢谢
这是启用 Azure Data Lake Storage 凭据直通时的预期行为。
注意:当为 Azure Data Lake Storage 凭据直通启用集群时,该集群上的命令 运行 可以读取和写入 Azure Data Lake Storage 中的数据,而无需要求用户配置服务主体凭据以访问存储。凭据是根据发起操作的用户自动设置的。
参考: Enable Azure Data Lake Storage credential passthrough for your workspace and Simplify Data Lake Access with Azure AD Credential Passthrough.
可能您忘记在容器的访问控制 (IAM) 中添加权限。
要检查这一点,您可以转到 Azure 门户中的容器并单击 Switch to Azure AD User Account
。如果您没有权限,您将看到一条错误消息。
例如,您可以添加角色 Storage Blob Data Contributor
以具有读写权限。
注意:Datalake 需要几分钟来刷新凭据,因此您需要在添加角色后稍等片刻。
我想了解为什么我的 ACL 权限在 Databricks 中无法正常工作。
场景:我有 2 个用户。一个对 FileSystem 和具有完全权限的人。其他没有任何权限。
我尝试使用两种不同的方法在数据块中安装 Gen2 文件系统。
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": clientid, "fs.azure.account.oauth2.client.secret": credential, "fs.azure.account.oauth2.client.endpoint": refresh_url} dbutils.fs.mount( source = "abfss://xyz@abc.dfs.core.windows.net/", mount_point = "/mnt/xyz", extra_configs = configs)
并使用直通 2.
configs = {
"fs.azure.account.auth.type": "CustomAccessToken",
"fs.azure.account.custom.token.provider.class": spark.conf.get("spark.databricks.passthrough.adls.gen2.tokenProviderClassName")
}
dbutils.fs.mount(
source = "abfss://xyz@abc.dfs.core.windows.net/",
mount_point = "/mnt/xyz",
extra_configs = configs)
两者都挂载文件系统。但是当我使用:
dbfs.fs.ls("/mnt/xyz")
它显示没有数据湖权限的用户的所有内容文件/文件夹。
如果有人能向我解释问题出在哪里,我会很高兴。
谢谢
这是启用 Azure Data Lake Storage 凭据直通时的预期行为。
注意:当为 Azure Data Lake Storage 凭据直通启用集群时,该集群上的命令 运行 可以读取和写入 Azure Data Lake Storage 中的数据,而无需要求用户配置服务主体凭据以访问存储。凭据是根据发起操作的用户自动设置的。
参考: Enable Azure Data Lake Storage credential passthrough for your workspace and Simplify Data Lake Access with Azure AD Credential Passthrough.
可能您忘记在容器的访问控制 (IAM) 中添加权限。
要检查这一点,您可以转到 Azure 门户中的容器并单击 Switch to Azure AD User Account
。如果您没有权限,您将看到一条错误消息。
例如,您可以添加角色 Storage Blob Data Contributor
以具有读写权限。
注意:Datalake 需要几分钟来刷新凭据,因此您需要在添加角色后稍等片刻。