简体   繁体   English

在 Azure Databricks 中编辑 Azure 存储帐户

[英]Editing the Azure Storage Account in Azure Databricks

I have databricks pointing to a storage account in Azure but the region was incorrect.我的数据块指向 Azure 中的存储帐户,但该区域不正确。 Now I want to change it and point it to a different storage account.现在我想更改它并将其指向不同的存储帐户。 I have used the mount option with the code as below我在代码中使用了挂载选项,如下所示

dbutils.fs.mount(
    source = "wasbs://" + mountname + "@" + storageAccount + ".blob.core.windows.net",
    mount_point = root + mountname ,
    extra_configs = {"fs.azure.account.key." + storageAccount + ".blob.core.windows.net":dbutils.secrets.get(scope = "", key = "")})

This executes properly, but once I use %fs ls dbfs:/mnt/ to list the directories, it shows the directories of the old storage account.这可以正确执行,但是一旦我使用 %fs ls dbfs:/mnt/ 列出目录,它就会显示旧存储帐户的目录。

Do let me know how I can achieve this if it is possible?如果可能的话,请告诉我如何实现这一目标?

All you need to do, just unmount the existing storage account and mount it with correct storage account which you are referring to different storage account.您需要做的就是卸载现有的存储帐户,然后使用您指的不同存储帐户的正确存储帐户安装它。

OR要么

Create a new mount point with reference to the new storage account.参考新的存储帐户创建一个新的装载点。

Unmount a mount point:卸载挂载点:

dbutils.fs.unmount("/mnt/<mountname>")

在此处输入图像描述

To mount a Blob Storage container or a folder inside a container, use the following command:要装载 Blob 存储容器或容器内的文件夹,请使用以下命令:

dbutils.fs.mount(
  source = "wasbs://<container-name>@<storage-account-name>.blob.core.windows.net/<directory-name>",
  mountPoint = "/mnt/<mount-name>",
  extraConfigs = Map("<conf-key>" -> dbutils.secrets.get(scope = "<scope-name>", key = "<key-name>")))

在此处输入图像描述

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

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