Skip to content

Latest commit

 

History

History
54 lines (44 loc) · 3.34 KB

File metadata and controls

54 lines (44 loc) · 3.34 KB

Additional Information

Example: Creating and Using a Secret for your New Relic License Key

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.

  1. Follow the steps to install or update the Databricks CLI.

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

  3. 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]"
    }'
  4. Set the custom environment variable named NEW_RELIC_LICENSE_KEY and reference the value from the secret by following the steps to configure custom environment variables, adding the following line after the last entry in the Environment variables field.

    NEW_RELIC_LICENSE_KEY={{secrets/newrelic/licenseKey}}

Notes