Azure “连接到Blob存储”;在配置中找不到他们的凭据;
我正在使用由spark cluster支持的Databricks笔记本电脑。尝试连接Azure blob存储时遇到问题。我使用了这个,并尝试了直接访问Azure Blob存储-设置帐户访问密钥部分。我在这里没有错误:Azure “连接到Blob存储”;在配置中找不到他们的凭据;,azure,databricks,Azure,Databricks,我正在使用由spark cluster支持的Databricks笔记本电脑。尝试连接Azure blob存储时遇到问题。我使用了这个,并尝试了直接访问Azure Blob存储-设置帐户访问密钥部分。我在这里没有错误: spark.conf.set( "fs.azure.account.key.<your-storage-account-name>.blob.core.windows.net", "<your-storage-account-access-key>"
spark.conf.set(
"fs.azure.account.key.<your-storage-account-name>.blob.core.windows.net",
"<your-storage-account-access-key>")
spark.conf.set(
“fs.azure.account.key..blob.core.windows.net”,
"")
但在我尝试对目录执行“ls”时收到错误:
dbutils.fs.ls("wasbs://<your-container-name>@<your-storage-account-name>.blob.core.windows.net/<your-directory-name>")
shaded.databricks.org.apache.hadoop.fs.azure.AzureException: shaded.databricks.org.apache.hadoop.fs.azure.AzureException: Unable to access container <container name> in account <storage account name>core.windows.net using anonymous credentials, and no credentials found for them in the configuration.
dbutils.fs.ls(“wasbs://@.blob.core.windows.net/”)
shaded.databricks.org.apache.hadoop.fs.azure.AzureException:shaded.databricks.org.apache.hadoop.fs.azure.Exception:无法使用匿名凭据访问帐户core.windows.net中的容器,并且在配置中找不到这些容器的凭据。
如果有更好的方法,也请提供建议。谢谢1)您需要在设置配置时传递**存储帐户名**和**键**。您可以从azure门户找到此内容。
1) You need to pass the **storage account name** and **key** while setting up the configuration . You can find this from azure portal.
spark.conf.set(
"fs.azure.account.key.<your-storage-account-name>.blob.core.windows.net",
"<your-storage-account-access-key>")
2) Also while doing the ls you need to add
**Container name** and **directory name.**
dbutils.fs.ls("wasbs://<your-container-name>@<your-storage-account-name>.blob.core.windows.net/<your-directory-name>")
Hope this will resolve your issue!
spark.conf.set(
“fs.azure.account.key..blob.core.windows.net”,
"")
2) 在进行ls时,您还需要添加
**容器名称**和**目录名称**
dbutils.fs.ls(“wasbs://@.blob.core.windows.net/”)
希望这能解决你的问题!
您是否如文档中所述“为给定容器设置SAS”?