-
-
Save BrendanThompson/7eeb116f87c27855cc8c369365b42f2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val storageAccountName = "<storage-account-name>" | |
val appID = "<app-id>" | |
val secret = "<secret>" | |
val fileSystemName = "<file-system-name>" | |
val tenantID = "<tenant-id>" | |
spark.conf.set("fs.azure.account.auth.type." + storageAccountName + ".dfs.core.windows.net", "OAuth") | |
spark.conf.set("fs.azure.account.oauth.provider.type." + storageAccountName + ".dfs.core.windows.net", "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider") | |
spark.conf.set("fs.azure.account.oauth2.client.id." + storageAccountName + ".dfs.core.windows.net", "" + appID + "") | |
spark.conf.set("fs.azure.account.oauth2.client.secret." + storageAccountName + ".dfs.core.windows.net", "" + secret + "") | |
spark.conf.set("fs.azure.account.oauth2.client.endpoint." + storageAccountName + ".dfs.core.windows.net", "https://login.microsoftonline.com/" + tenantID + "/oauth2/token") | |
spark.conf.set("fs.azure.createRemoteFileSystemDuringInitialization", "true") | |
dbutils.fs.ls("abfss://" + fileSystemName + "@" + storageAccountName + ".dfs.core.windows.net/") | |
spark.conf.set("fs.azure.createRemoteFileSystemDuringInitialization", "false") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment