Edit

Share via


Configure customer-managed keys

Azure Data Explorer encrypts all data in a storage account at rest. By default, it uses Microsoft-managed keys for encryption. If you want more control over the encryption keys, you can provide customer-managed keys for data encryption.

You must store customer-managed keys in an Azure Key Vault. You can create your own keys and store them in a key vault, or you can use an Azure Key Vault API to generate keys. The Azure Data Explorer cluster and the key vault must be in the same region, but they can be in different subscriptions. For a detailed explanation of customer-managed keys, see customer-managed keys with Azure Key Vault.

This article shows you how to configure customer-managed keys.

For code samples based on previous SDK versions, see the archived article.

Configure Azure Key Vault

To configure customer-managed keys with Azure Data Explorer, you must set two properties on the key vault: Soft Delete and Do Not Purge. These properties aren't enabled by default. To enable these properties, perform Enabling soft-delete and Enabling Purge Protection in PowerShell or Azure CLI on a new or existing key vault. Azure Data Explorer supports RSA and RSA-HSM keys of size 2048, 3072, and 4096. To use RSA-HSM keys, use the C#, Azure CLI, PowerShell, or ARM Template methods described in this article. For more information about keys, see Key Vault keys.

Note

For information about the limitations of using customer managed keys on leader and follower clusters, see Limitations.

Assign a managed identity to the cluster

To enable customer-managed keys for your cluster, first assign either a system-assigned or user-assigned managed identity to the cluster. Use this managed identity to grant the cluster permissions to access the key vault. To configure managed identities, see managed identities.

Enable encryption by using customer-managed keys

The following steps explain how to enable customer-managed keys encryption by using the Azure portal. By default, Azure Data Explorer encryption uses Microsoft-managed keys. Configure your Azure Data Explorer cluster to use customer-managed keys and specify the key to associate with the cluster.

  1. In the Azure portal, go to your Azure Data Explorer cluster resource.

  2. Select Settings > Encryption in the left pane of the portal.

  3. In the Encryption pane, select On for the Customer-managed key setting.

  4. Select Select Key.

    Screenshot showing configure customer-managed keys.

  5. In the Select key from Azure Key Vault window, select an existing Key vault from the dropdown list. If you select Create new to create a new Key Vault, you're routed to the Create Key Vault screen.

  6. Select Key.

  7. Version:

    • To ensure that this key always uses the latest key version, select the Always use current key version checkbox.
    • Otherwise, select Version.
  8. Select Select.

    Screenshot showing the Select key from Azure Key Vault.

  9. Under Identity type, select System Assigned or User Assigned.

  10. If you select User Assigned, pick a user assigned identity from the dropdown.

    Screenshot showing the option to select a managed identity type.

  11. In the Encryption pane that now contains your key, select Save. When CMK creation succeeds, you see a success message in Notifications.

    Screenshot showing option to save a customer-managed key.

If you select system assigned identity when enabling customer-managed keys for your Azure Data Explorer cluster, you create a system assigned identity for the cluster if one doesn't exist. In addition, you provide the required get, wrapKey, and unwrapKey permissions to your Azure Data Explorer cluster on the selected Key Vault and get the Key Vault properties.

Note

Select Off to remove the customer-managed key after it exists.

Update the key version

When you create a new version of a key, you need to update the cluster to use the new version. First, call Get-AzKeyVaultKey to get the latest version of the key. Then update the cluster's key vault properties to use the new version of the key, as shown in Enable encryption by using customer-managed keys.