Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Task 04: Generate a key for Databricks in Key Vault

Introduction

Sensitive credentials should never be embedded directly in notebooks or code. Azure Key Vault provides a secure way to store secrets and keys that Databricks can access at runtime.

Description

You’ll be using Azure Databricks in this workshop to process data. In this task, you’ll generate a key for Azure Databricks in Azure Key Vault. The key will be used later in the workshop to allow access to resources.

Example scenario

Zava’s Databricks workloads require secure access to external services. Instead of hardcoding secrets, the team stores credentials in Key Vault and references them securely from Databricks.

Success criteria

A Key Vault secret is created and the Key Vault URI and Resource ID are available for later use in the lab.

Learning resources

  • Azure Key Vault overview
  • Secure secrets management for Databricks

Key tasks

01: Create a key vault access policy

  1. Return to the Azure web page.

  2. In the Search field, search for and select Key vaults.

    0cmd2ppy.jpg

  3. Select the kv-adb-@lab.LabInstance.Id key vault.

    jzlwdu4g.jpg

  4. In the left pane, select Access policies.

    seokir33.jpg

  5. On the Access policies page, select + Create.

    6qo0sl36.jpg

  6. In the Secret permissions column, select the following options and then select Next:

    • Get
    • List
    • Set

    6va2e3ha.jpg

  7. On the Principal page, search for and select @lab.CloudPortalCredential(User1).Username. Then, select Next twice.

    uhu9655h.jpg

  8. On the Review + create page, select Create.

    wxqc90e0.jpg


02: Create a secret

  1. In the left pane, expand Objects and select Secrets.

    hd0kri4p.jpg

  2. On the command bar, select + Generate/Import.

    evgsrfre.jpg

  3. Configure the secret by entering the following values and then select Create.

    Field Value
    Name DatabricksSecret
    Value SecretValueFor@lab.LabInstance.Id

    iucneovs.jpg

  4. In the left pane, expand Settings and select Properties.

    6uryzl6l.jpg

  5. In the Vault URI field, copy the value.

    2z3g93ds.jpg

  6. Paste the value into a Notepad file, for later use.

  7. In the Resource ID field, copy the value.

    yt6zywdv.jpg

  8. Paste the value into a Notepad file, for later use.

  9. Leave the Azure page open.