@Bhaskar - Thanks for the question and using MS Q&A platform.
It seems like you are trying to read a file from ADLS using spark-shell. Based on the error message you provided, it seems like there is an issue with the configuration values you have set for the storage account.
Here are a few things you can check to resolve the issue:
Make sure that the values you have set for storageAccountName
, clientId
, clientSecret
, and tenantId
are correct and correspond to your ADLS account.
Check if you have set the correct configuration values for the storage account. You can try setting the configuration values using the following code:
spark.conf.set("fs.azure.account.auth.type.<your-storage-account-name>.dfs.core.windows.net", "OAuth")
spark.conf.set("fs.azure.account.oauth.provider.type.<your-storage-account-name>.dfs.core.windows.net", "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider")
spark.conf.set("fs.azure.account.oauth2.client.id.<your-storage-account-name>.dfs.core.windows.net", "<your-client-id>")
spark.conf.set("fs.azure.account.oauth2.client.secret.<your-storage-account-name>.dfs.core.windows.net", "<your-client-secret>")
spark.conf.set("fs.azure.account.oauth2.client.endpoint.<your-storage-account-name>.dfs.core.windows.net", "https://login.microsoftonline.com/<your-tenant-id>/oauth2/token")
Make sure that you have the correct permissions to access the file in ADLS. You can check the permissions by going to the Azure portal and checking the access control settings for the file.
For more details, refer to the below links:
https://hadoop.apache.org/docs/stable/hadoop-azure/abfs.html#Configuring_ABFS
https://deep.data.blog/2019/07/12/diy-apache-spark-and-adls-gen-2-support/
If you have checked all of the above and still face the issue, please let me know and I can help you further.
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.