cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to update table location with wasb to abfss

lazcanja
New Contributor

I created a table including location such as: 

wasb://<container>@<storageaccount>.blob.core.windows.net/foldername 

We have updated access to storage accounts to use abfss

I am trying to execute the following command: 

alter table mydatabase.mytable
set location ' abfss://<container>@<storageaccount>.dfs.core.windows.net/foldername

I am getting the error:


Failure to initialize configuration for storage account <storageaccount>.dfs.core.windows.net: Invalid configuration value detected for fs.azure.account.keyInvalid configuration value detected for fs.azure.account.key

On the cluster I have changed:

spark.hadoop.fs.azure.account.key.<storageaccount>.blob.core.windows.net {{secrets/<proyect>/<storageaccount>}}

to this:

spark.hadoop.fs.azure.account.key.<storageaccount>.dfs.core.windows.net {{secrets/<proyect>/<storageaccount>}}

1 ACCEPTED SOLUTION

Accepted Solutions

Kaniz_Fatma
Community Manager
Community Manager

Hi @lazcanjaThe error message indicates an issue with the configuration value for the storage account key. The error might be due to an incorrect or invalid key.

Given the information provided, you have correctly changed the configuration from spark.hadoop.fs.azure.account.key<storageaccount>.blob.core.windows.net to

 spark.hadoop.fs.azure.account.key.<storageaccount>.dfs.core.windows.net to reflect the change from Blob Storage to data lake Storage Gen2.

However, ensuring the secret key {{secrets/<proyect>/<storageaccount>}} is correctly set and valid is critical. This secret should be the access key for your Azure data lake Storage account. 

If the private key is correct and the error persists, you might need to check the access control settings to ensure the necessary permissions are granted. 

Please note that to create an external table, you must have the following:-

- The CREATE EXTERNAL TABLE privilege on an external location that gives access to the LOCATION outer table access.
- The USE SCHEMA permission on the table's parent schema.
- The USE CATALOG permission on the table's parent catalogue.
- The CREATE TABLE permission on the table's parent schema.

Sources:
- [Docs: create-tables](https://docs.databricks.com/data-governance/unity-catalog/create-tables.html)
- [Docs: wasb-blob](https://docs.databricks.com/archive/storage/wasb-blob.html)
- [Docs: run-jobs-with-service-principals](https://docs.databricks.com/workflows/jobs/how-to/run-jobs-with-service-principals.html)

View solution in original post

1 REPLY 1

Kaniz_Fatma
Community Manager
Community Manager

Hi @lazcanjaThe error message indicates an issue with the configuration value for the storage account key. The error might be due to an incorrect or invalid key.

Given the information provided, you have correctly changed the configuration from spark.hadoop.fs.azure.account.key<storageaccount>.blob.core.windows.net to

 spark.hadoop.fs.azure.account.key.<storageaccount>.dfs.core.windows.net to reflect the change from Blob Storage to data lake Storage Gen2.

However, ensuring the secret key {{secrets/<proyect>/<storageaccount>}} is correctly set and valid is critical. This secret should be the access key for your Azure data lake Storage account. 

If the private key is correct and the error persists, you might need to check the access control settings to ensure the necessary permissions are granted. 

Please note that to create an external table, you must have the following:-

- The CREATE EXTERNAL TABLE privilege on an external location that gives access to the LOCATION outer table access.
- The USE SCHEMA permission on the table's parent schema.
- The USE CATALOG permission on the table's parent catalogue.
- The CREATE TABLE permission on the table's parent schema.

Sources:
- [Docs: create-tables](https://docs.databricks.com/data-governance/unity-catalog/create-tables.html)
- [Docs: wasb-blob](https://docs.databricks.com/archive/storage/wasb-blob.html)
- [Docs: run-jobs-with-service-principals](https://docs.databricks.com/workflows/jobs/how-to/run-jobs-with-service-principals.html)

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group