cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
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
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
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)

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.