简体   繁体   English

将 DataBrick 连接到 Azure Blob 存储

[英]Connecting DataBricks to Azure Blob Storage

I'm trying to mount an Azure Blob Storage Container to a DataBricks instance and while the mount does work, it appears not to be using the Storage Container.我正在尝试将 Azure Blob 存储容器挂载到 DataBricks 实例,虽然挂载确实有效,但它似乎没有使用存储容器。

Here is the code I'm using to create the mount...这是我用来创建安装的代码...

storageAccountName = 'x'
blobContainerName = 'files'
storageAccountAccessKey = 'x'

dbutils.fs.mount(
  source = f'wasbs://{blobContainerName}@{storageAccountName}.blob.core.windows.net',
  mount_point = '/mnt/files/',
  extra_configs = {'fs.azure.account.key.' + storageAccountName + '.blob.core.windows.net': storageAccountAccessKey}
)

The mount seems to work sucessfully.安装似乎成功地工作。

I then download a file into the mounted location...然后我将文件下载到安装位置...

%sh

wget https://www.stats.govt.nz/assets/Uploads/Annual-enterprise-survey/Annual-enterprise-survey-2019-financial-year-provisional/Download-data/annual-enterprise-survey-2019-financial-year-provisional-csv.csv -P /mnt/files/

I then list the files within the mounted location然后我列出挂载位置中的文件

%sh

ls /mnt/samplefiles/

This does show the downloaded file (annual-enterprise-survey-2019-financial-year-provisional-csv.csv), but doesn't show the file already in the Storage Account, nor does the downloaded file every appear in the Storage Account.这确实显示了下载的文件 (annual-enterprise-survey-2019-financial-year-provisional-csv.csv),但没有显示存储帐户中已经存在的文件,下载的文件也没有出现在存储帐户中.

What am I missing here?我在这里想念什么?

I needed to add /dbfs/ to the mount location.我需要将 /dbfs/ 添加到安装位置。

For example...例如...

ls /dbfs/mnt/samplefiles

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM