Sensitive data like credentials and API keys should never be specified directly in custom environment variables. Instead, it is recommended to create a secret and reference the secret in the environment variable.
For example, the init script used to
install the Databricks Integration when deploying the integration to a Databricks cluster
requires the New Relic license key to be specified in the environment variable
named NEW_RELIC_LICENSE_KEY. The steps below show an example of using the Databricks CLI
to create a secret
for the New Relic license key and reference it in a custom environment variable.
These steps can be repeated for each custom environment variable
that contains sensitive data.
-
Follow the steps to install or update the Databricks CLI.
-
Use the Databricks CLI to create a Databricks-backed secret scope with the name
newrelic. For example,databricks secrets create-scope newrelic
NOTE: This step can also be done using the Databricks workspace UI.
-
Use the Databricks CLI to create a secret for the license key in the new scope with the name
licenseKey. For example,databricks secrets put-secret --json '{ "scope": "newrelic", "key": "licenseKey", "string_value": "[YOUR_LICENSE_KEY]" }'
-
Set the custom environment variable named
NEW_RELIC_LICENSE_KEYand reference the value from the secret by following the steps to configure custom environment variables, adding the following line after the last entry in theEnvironment variablesfield.NEW_RELIC_LICENSE_KEY={{secrets/newrelic/licenseKey}}
- All references within the Databricks Integration documentation to Databricks documentation reference the Databricks on AWS documentation. Use the cloud switcher menu located in the upper right hand corner of the Databricks documentation to select the corresponding documentation for a different cloud provider.