-
Notifications
You must be signed in to change notification settings - Fork 0
/
config - mount Azure Storage.py
48 lines (36 loc) · 1.61 KB
/
config - mount Azure Storage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Databricks notebook source
# MAGIC %md
# MAGIC ##### This Config needs to be Executed only once before starting with the transformations.
# COMMAND ----------
configs = {
"fs.azure.account.auth.type": "CustomAccessToken",
"fs.azure.account.custom.token.provider.class": spark.conf.get("spark.databricks.passthrough.adls.gen2.tokenProviderClassName")
}
# Here container name will be 'bronze' and replace storage account name from azure portal.
dbutils.fs.mount(
source = "abfss://<container-name>@<storage-account-name>.dfs.core.windows.net/",
mount_point = "/mnt/bronze",
extra_configs = configs)
# COMMAND ----------
# verify the mounted storage details
dbutils.fs.ls("/mnt/bronze/SalesLT")
# COMMAND ----------
configs = {
"fs.azure.account.auth.type": "CustomAccessToken",
"fs.azure.account.custom.token.provider.class": spark.conf.get("spark.databricks.passthrough.adls.gen2.tokenProviderClassName")
}
# Here container name will be 'silver' and replace storage account name from azure portal.
dbutils.fs.mount(
source = "abfss://<container-name>@<storage-account-name>.dfs.core.windows.net/",
mount_point = "/mnt/silver",
extra_configs = configs)
# COMMAND ----------
configs = {
"fs.azure.account.auth.type": "CustomAccessToken",
"fs.azure.account.custom.token.provider.class": spark.conf.get("spark.databricks.passthrough.adls.gen2.tokenProviderClassName")
}
# Here container name will be 'gold' and replace storage account name from azure portal.
dbutils.fs.mount(
source = "abfss://<container-name>@<storage-account-name>.dfs.core.windows.net/",
mount_point = "/mnt/gold",
extra_configs = configs)