在Azure Databricks中,当我们从Azure Blob存储读取数据时无法正常工作

时间:2019-01-31 12:57:10

标签: databricks azure-blob-storage azure-databricks

i尝试从Data Bricks中的Azure Blob存储获取数据

Unable to access container $root in account "AccountName" using anonymous credentials, and no credentials found for them  in the configuration

代码

        storage_account_name = "storage_account_name"
        storage_account_access_key ="key"

    file_location = "wasbs://Accountname/Contianername/filename.csv"  --Try1 not work same error message
   file_location = "wasbs:/Contianername/filename.csv"--Try2 not working same error

    file_type = "csv"

    spark.conf.set(
      "fs.azure.account.key."+storage_account_name+".blob.core.windows.net",
      storage_account_access_key)

df = spark.read.format(file_type).option("inferSchema", "true").load(file_location)

我是Azure数据砖的新手,我知道存在一些权限问题,但不知道问题出在哪里

0 个答案:

没有答案
相关问题