我正在尝试使用 Azure 文档中给出的语法在容器上的 Azure Storage Gen2 中创建安装点。我发现了两种使用“abfss”进行 Gen2 和使用“wasbs”进行常规 blob 存储的方法。由于我使用的是 'Storage Gen2' ,所以使用 'abfss' 但这不起作用。虽然如果我使用“wasb”它就可以安装。不知道为什么。我很困惑
语法-1
url = "wasbs://"+container+"@"+storage_name+".blob.core.windows.net"
config = "fs.azure.account.key."+storage_name+".blob.core.windows.net"
语法2
url="abfss://"+container+"@"+storage_name+".dfs.core.windows.net"
as_config = "fs.azure.account.key."+storage_name+".dfs.core.windows.net
当我使用 Syntax-2 时,出现错误:
ExecutionError: An error occurred while calling o246.mount. : java.lang.NullPointerException: authEndpoint at shaded.databricks.v20180920_b33d810.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204)
最佳答案
您无法使用存储 key 挂载 abfss
- 它仅适用于 wasbs
(正如您所确认的那样)。只能使用服务主体来安装 abfss
,如 documentation 中所述。 :
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)
关于azure - 无法从 Azure DataBricks 在存储 Gen2 上创建装载 [wasbs 与 abfss],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67643851/