cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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

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_Fatma
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

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...

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group