gpt4 book ai didi

azure - 错误 : Invalid configuration value detected for fs. azure.account.key

转载 作者:行者123 更新时间:2023-12-02 22:49:51 30 4
gpt4 key购买 nike

我正在使用 Azure Databricks 使用 ADLS Gen2 在 Azure Blob 存储中创建增量表,但在最后一行收到错误“初始化配置失败检测到 fs.azure.account.key 的配置值无效”

%scala
spark.conf.set(
"fs.azure.account.oauth2.client.secret",
"<storage-account-access-key>")
friends = spark.read.csv('myfile/fakefriends-header.csv',
inferSchema = True, header = True)
friends.write.format("delta").mode('overwrite')\
.save("abfss://temp<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c0a6a9aca580b4a5adb0a1a3a3afb5aeb4eea4a6b3eea3afb2a5eeb7a9aea4afb7b3eeaea5b4" rel="noreferrer noopener nofollow">[email protected]</a>/myfile/friends_new")

请帮我解决如何避免此错误

最佳答案

简短回答 - 您无法使用存储帐户访问 key 通过 abfss 协议(protocol)访问数据。如果您想使用 abfss,您需要提供更多配置选项 - documentation 中对此进行了全部描述。 .

spark.conf.set(
"fs.azure.account.auth.type.<storage-account-name>.dfs.core.windows.net",
"OAuth")
spark.conf.set(
"fs.azure.account.oauth.provider.type.<storage-account-name>.dfs.core.windows.net",
"org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider")
spark.conf.set(
"fs.azure.account.oauth2.client.id.<storage-account-name>.dfs.core.windows.net",
"<application-id>")
spark.conf.set(
"fs.azure.account.oauth2.client.secret.<storage-account-name>.dfs.core.windows.net",
dbutils.secrets.get(scope="<scope-name>",key="<service-credential-key-name>"))
spark.conf.set(
"fs.azure.account.oauth2.client.endpoint.<storage-account-name>.dfs.core.windows.net",
"https://login.microsoftonline.com/<directory-id>/oauth2/token")

存储访问 key 仅在您使用 wasbs 时才能使用,但不建议与 ADLSGen2 一起使用。

附注您还可以使用passthrough cluster如果您有权访问该存储帐户。

关于azure - 错误 : Invalid configuration value detected for fs. azure.account.key,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69825487/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com