[英]Not able to create mount on Storage Gen2 from Azure DataBricks [wasbs vs abfss]
I am trying to create a mount point in Azure Storage Gen2 over a container, using the syntax given on Azure docs.我正在尝试使用 Azure 文档中给出的语法在容器上的 Azure Storage Gen2 中创建安装点。 I found 2 ways using 'abfss' for Gen2 and 'wasbs' for regular blob storage.我发现 2 种方法使用 Gen2 的“abfss”和常规 Blob 存储的“wasbs”。 Since I am using 'Storage Gen2', so using 'abfss' but that not working.由于我使用的是“Storage Gen2”,所以使用了“abfss”,但这不起作用。 Although if I use 'wasb' its able to mount.虽然如果我使用'wasb'它可以安装。 Not sure why.不知道为什么。 I am confused我很困惑
Syntax-1语法-1
url = "wasbs://"+container+"@"+storage_name+".blob.core.windows.net"
config = "fs.azure.account.key."+storage_name+".blob.core.windows.net"
Syntax-2语法 2
url="abfss://"+container+"@"+storage_name+".dfs.core.windows.net"
as_config = "fs.azure.account.key."+storage_name+".dfs.core.windows.net
When I use Syntax-2, gets error:当我使用 Syntax-2 时,出现错误:
ExecutionError: An error occurred while calling o246.mount. ExecutionError:调用 o246.mount 时出错。 : java.lang.NullPointerException: authEndpoint at shaded.databricks.v20180920_b33d810.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204) : java.lang.NullPointerException: authEndpoint at shaded.databricks.v20180920_b33d810.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204)
You can't mount the abfss
using the storage key - it works only for wasbs
(as it's confirmed by you).您不能使用存储密钥安装abfss
- 它仅适用于wasbs
(您已确认)。 Mounting of abfss
is possible only using service principal, as it's described in documentation :只能使用服务主体安装abfss
,如文档中所述:
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": "<application-id>",
"fs.azure.account.oauth2.client.secret": dbutils.secrets.get(scope="<scope-name>",key="<service-credential-key-name>"),
"fs.azure.account.oauth2.client.endpoint": "https://login.microsoftonline.com/<directory-id>/oauth2/token"}
# Optionally, you can add <directory-name> to the source URI of your mount point.
dbutils.fs.mount(
source = "abfss://<container-name>@<storage-account-name>.dfs.core.windows.net/",
mount_point = "/mnt/<mount-name>",
extra_configs = configs)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.