spark icon indicating copy to clipboard operation
spark copied to clipboard

Accessing config/secret values

Open guruvonline opened this issue 5 years ago • 13 comments

is there any option to access config/secret values from C#? i need to access keys like EventHub connection string, Application Insights keys etc.

i can create secret scope in Databricks and access in my python script as

'dbutils.secrets.get(scope = "", key = "")'

how to do similar thing in C#

guruvonline avatar Jul 10 '19 00:07 guruvonline

Can you please elaborate what you are trying to do?

imback82 avatar Jul 10 '19 16:07 imback82

for my c# app i have to keep few config secrets like EventHub connection string(s), Application Insights connection string, connection string for my Configuration store. What is the recommended approach of accessing multiple configuration/Secret values in C#?

as per azure databricks documentation this can be done in scala/python using secret scopes. Is there any recommendation/suggestion of doing it in C#?

guruvonline avatar Jul 10 '19 17:07 guruvonline

@guruvonline: Have you tried Azure KeyVault?

rapoth avatar Jul 16 '19 00:07 rapoth

@guruvonline A couple guides that may help. Set and retrieve a secret - .NET and Get Key Vault Secret via REST API

suhsteve avatar Jul 16 '19 03:07 suhsteve

@guruvonline: Did you get this to work with the guides above?

rapoth avatar Jul 17 '19 16:07 rapoth

I am using Azure Databricks , which doesn't support managed identity to connect to KeyVault. so i have to keep secret in my code to access Keyvault. For C# app to work to connect to keyvault, i have to keep secret to connect to keyvault in some file on dbfs. So secret to access my secret is not secure.

in pyspark as part of one time cluster configuration, i can create secrete scope, and in my pyspark code i can directly read keyvault values.

is there any recommendation on how to keep secret to access secrestore(keyvault) from c# .net for spark?

guruvonline avatar Jul 17 '19 23:07 guruvonline

closed by mistake

guruvonline avatar Jul 17 '19 23:07 guruvonline

+1 Please advise on this issue.

ksiomelo avatar Nov 06 '19 03:11 ksiomelo

+1

ravisgoli avatar Nov 08 '19 19:11 ravisgoli

Unfortunately, dbutils is closed source and there is not much we can do to add support (we are open to contributions, however!). This may change if Databricks decides to open source dbutils or adds support themselves. Have you considered making a feature request to Databricks?

rapoth avatar Nov 09 '19 01:11 rapoth

+1 here too. I'm ok with using keyvault for secrets but the problem is how to manage the bootstrapping secrets that help you connect to keyvault in the first place.

dbeavon avatar Mar 30 '21 13:03 dbeavon

This has been submitted with Databricks.

The Databricks issue tracking (in SF) case number is 00101202

We should get an update from them. I will update this issue once I have more information.

dbeavon avatar Apr 27 '21 13:04 dbeavon

This is an update from Databricks Team following the SF number: 00101202

“We can treat this as a feature request I have already created for this. Here is the request number - DB-I-3505”

dbeavon avatar Apr 28 '21 19:04 dbeavon