- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2020 07:59 PM
If you use scala to mount a gen 2 data lake you could try something like this
/Gather relevant Keys/
var ServicePrincipalID = ""
var ServicePrincipalKey = ""
var DirectoryID = ""
/Create configurations for our connection/
var configs = Map ("fs.azure.account.auth.type" -> "OAuth",
"fs.azure.account.oauth.provider.type" -> "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider", "fs.azure.account.oauth2.client.id" -> ServicePrincipalID,
"fs.azure.account.oauth2.client.secret" -> ServicePrincipalKey, "fs.azure.account.oauth2.client.endpoint" -> DirectoryID)
// Optionally, you can add <directory-name> to the source URI of your mount point.
if (dbutils.fs.mounts.map(mnt => mnt.mountPoint).contains("/mnt/ventas")){
"already mount"
}else{
dbutils.fs.mount( source = "/", mountPoint = "/mnt/", extraConfigs = configs) }