adls-passthrough-gen1(Python)

Loading...
df = spark.read.json("dbfs:/databricks-datasets/iot/iot_devices.json")
configs = { 
"fs.adl.oauth2.access.token.provider.type": "CustomAccessTokenProvider",
"fs.adl.oauth2.access.token.custom.provider": spark.conf.get("spark.databricks.passthrough.adls.tokenProviderClassName")
}
dbutils.fs.ls("adl://<storage-resource>.azuredatalakestore.net/")
df.write.json("adl://<storage-resource>.azuredatalakestore.net/iot_devices.json")
df2 = spark.read.json("adl://<storage-resource>.azuredatalakestore.net/iot_devices.json")
display(df2)
dbutils.fs.mount(
  source = "adl://<storage-resource>.azuredatalakestore.net/",
  mount_point = "/mnt/mymount",
  extra_configs = configs)
dbutils.fs.ls("/mnt/mymount") 
dbutils.fs.unmount("/mnt/mymount")