I'm using the code below to mount gen1 account on azure databricks
configs = {"fs.adl.oauth2.access.token.provider.type": "ClientCredential",
"fs.adl.oauth2.client.id": <service-principal-appid>,
"fs.adl.oauth2.credential":<storage-account-access-key>,
"fs.adl.oauth2.refresh.url": "https://login.microsoftonline.com/<tenant-id>/oauth2/token"}
dbutils.fs.mount(
source = "adl://<storageaccountname>.azuredatalakestore.net/",
mount_point = "/mnt/<container>",
extra_configs = configs)
It mounts successfully, however, when I try to list the files using dbutils.fs.ls(/mnt/<container>), it throws the error below. The Service principal I'm using has owner role over the storage account.
An error occurred while calling z:com.databricks.backend.daemon.dbutils.FSUtils.ls.
: com.microsoft.azure.datalake.store.ADLException: Error enumerating directory /
Error fetching access token
Operation null failed with exception java.io.IOException : Server returned HTTP response code: 401 for URL: