cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

How to access databricks secret in global ini file

Sebastian
Contributor

How to access databricks secret in global ini file. {{secrets/scope/key}} doesnt work. Do i have to put that inside quotes

1 ACCEPTED SOLUTION

Accepted Solutions

Kaniz
Community Manager
Community Manager

Hi @SEBIN THOMAS​ ,

Here are the steps to access secrets in databricks initscript:

  1. Go to cluster
  2. Click Edit next to the Cluster information.
  3. On the Configure Cluster page, click Advanced Options.
  4. On the Spark tab, enter the following Spark Config:

Sample ini code:

 fs.azure.account.auth.type.chepragen2.dfs.core.windows.net OAuth
 fs.azure.account.oauth.provider.type.chepragen2.dfs.core.windows.net org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider
 fs.azure.account.oauth2.client.id.chepragen2.dfs.core.windows.net {<!-- -->{secrets/KeyVaultName/ClientID}}
 fs.azure.account.oauth2.client.secret.chepragen2.dfs.core.windows.net {<!-- -->{secrets/KeyVaultName/ClientSecret}}
 fs.azure.account.oauth2.client.endpoint.chepragen2.dfs.core.windows.net https://login.microsoftonline.com/<Directory_ID>/oauth2/token

Screenshot 2021-11-16 at 1.05.56 PM 

You can also go through the link for more details:-

https://docs.microsoft.com/en-us/azure/databricks/tutorials/run-jobs-with-service-principals#--creat...

View solution in original post

5 REPLIES 5

Kaniz
Community Manager
Community Manager

Hi @ Sebastian! My name is Kaniz, and I'm the technical moderator here. Great to meet you, and thanks for your question! Let's see if your peers in the community have an answer to your question first. Or else I will get back to you soon. Thanks.

Hubert-Dudek
Esteemed Contributor III

I think we need more details. Are you reading SAP Hana data in databricks? or reverse? As global.ini is something related to SAP

https://blogs.sap.com/2019/10/24/your-sap-on-azure-part-22-read-sap-hana-data-from-azure-databricks/

jose_gonzalez
Moderator
Moderator

hi @SEBIN THOMAS​ ,

I would like to share the docs here are you getting any error messages? like @Hubert Dudek​ mentioned, please share more details and error message in case you are getting any.

Thanks everyone

Do you have a sample ini script that access secrets. It’s more like a syntax issue

i managed with spark ini config of the cluster rather than through ini script

Kaniz
Community Manager
Community Manager

Hi @SEBIN THOMAS​ ,

Here are the steps to access secrets in databricks initscript:

  1. Go to cluster
  2. Click Edit next to the Cluster information.
  3. On the Configure Cluster page, click Advanced Options.
  4. On the Spark tab, enter the following Spark Config:

Sample ini code:

 fs.azure.account.auth.type.chepragen2.dfs.core.windows.net OAuth
 fs.azure.account.oauth.provider.type.chepragen2.dfs.core.windows.net org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider
 fs.azure.account.oauth2.client.id.chepragen2.dfs.core.windows.net {<!-- -->{secrets/KeyVaultName/ClientID}}
 fs.azure.account.oauth2.client.secret.chepragen2.dfs.core.windows.net {<!-- -->{secrets/KeyVaultName/ClientSecret}}
 fs.azure.account.oauth2.client.endpoint.chepragen2.dfs.core.windows.net https://login.microsoftonline.com/<Directory_ID>/oauth2/token

Screenshot 2021-11-16 at 1.05.56 PM 

You can also go through the link for more details:-

https://docs.microsoft.com/en-us/azure/databricks/tutorials/run-jobs-with-service-principals#--creat...

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.