Databricks#

Databricks is the online notebook environment for analyzing data or quick experimenting.

The environment is available here and through your Okta dashboard.

This guide will show you how to create a scope and a secret key.

Requirements:

  • the databricks-cli as described here

Upstream documentation:

Secrets#

Secrets are stored in scopes, and groups are granted access to scopes.

Execute the following command to get a list of available scopes:

databricks secrets list-scopes

Start with creating a scope for your specific project:

databricks secrets create-scope fruit-salad

Let’s manage access to keys in this scope. Make sure to allow MANAGE permissions to your group, in this example that will be DB_Tech_Team_Engineering:

databricks secrets put-acl fruit-salad DB_Tech_Team_Engineering MANAGE

And now list the Access Control Lists associated with your new scope:

databricks secrets list-acls fruit-salad
[
  {
    "permission":"MANAGE",
    "principal":"DB_Tech_Team_Engineering"
  }
]

Add a secret to the scope:

databricks secrets put-secret fruit-salad best-fruit-in-town --string-value bananas

Execute the following command to get a list of secrets that exist within a certain scope:

databricks secrets list-secrets fruit-salad

Which could return something like this:

[
  {
    "key":"best-fruit-in-town",
    "last_updated_timestamp":1678797076764
  }
]

Use the following snippet in your notebook to access the secret value:

fruit = dbutils.secrets.get(scope="fruitsalad", key="best-fruit-in-town")