azure - 无法从 Azure DataBricks 在存储 Gen2 上创建装载 [wasbs 与 abfss]

标签 azure azure-storage databricks azure-databricks

我正在尝试使用 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/

相关文章:

python-3.x - 在 Azure 数据工厂中执行 Databricks Notebook 给出 : Operation on target Notebook1 failed

python - Flask RESTful API : Issue with db connection pool

linux - 将 JDK 安装到 Azure Batch 中池的计算节点

c# - 如何获取Azure存储队列大小/位置

azure - python 中的错误日志记录不适用于 azure databricks

azure - 使用 JDBC 从 Pyspark 更新表

wcf - WcfAzureSamples 上缺少 Microsoft.ServiceHosting.ServiceRuntime

azure - 将调试器附加到 IIS 工作进程时出错

c# - 将 C# 控制台应用程序发布为 Azure Web 作业

node.js - 在 Nodejs 的 Azure 表存储中插入实体时添加分区键属性