Skip to content

Commit

Permalink
Create test_setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
drcrook1 authored Jan 18, 2019
1 parent fd51200 commit c3fbdc3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test_setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Databricks notebook source
configs = {"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": dbutils.secrets.get(scope = "data-lake", key = "sp-app-id"), #Service Principal App ID
"fs.azure.account.oauth2.client.secret": dbutils.secrets.get(scope = "data-lake", key = "sp-password"), #Service Principal Key
"fs.azure.account.oauth2.client.endpoint": dbutils.secrets.get(scope = "data-lake", key = "sp-token-endpoint")} #directory id

# Optionally, you can add <your-directory-name> to the source URI of your mount point.
dbutils.fs.mount(
source = "abfss://[email protected]", #blobcontainername@storageaccount
mount_point = "/mnt/datalake",
extra_configs = configs)

# COMMAND ----------

census = sqlContext.read.format('csv').options(header='true', inferSchema='true').load("/mnt/datalake/AdultCensusIncome.csv")
display(census)

# COMMAND ----------

dbutils.fs.unmount("/mnt/datalake")

0 comments on commit c3fbdc3

Please sign in to comment.