This document provides step-by-step instructions for configuring Customer-managed Encryption Keys to encrypt data in Azure Storage Accounts. Please follow these instructions carefully to ensure proper setup and functionality.
This setup uses Azure’s Managed Key Services as the default. Integrating third-party encryption key providers should be supported, but we currently require the encryption key to be available in an Azure Key Vault.
Client Prerequisites
Administrative access to your Azure Entra ID (formerly Azure AD) tenant
Permissions to create and manage Azure Key Vault resources
Proper network connectivity to Azure services
Setup Instructions
Step 1: Application Registration
Sign in to the Azure Portal
Open a web browser and navigate to the following URL, replacing the placeholder values:
https://login.microsoftonline.com/<your-tenant-id>/oauth2/authorize?client_id=52e738b0-c8a2-4e64-b70b-792b5c3c5618&response_type=code&redirect_uri=<redirect-uri> |
Important: This step must be performed by a user with administrative privileges to grant admin consent in Azure Entra ID.
The client id points to our Application Registration, Legora BYOK. The redirect url does not matter, it can simply be set to localhost:3000 or app.eu.legora.com.
<Your-tenant-id> is a placeholder for the Microsoft tenant you would like to add the Legora service principal in.
3. Complete the authentication process and grant the requested permissions.
Step 2: Verify Application Registration
In In Azure Portal, Navigate to Azure Entra ID > Enterprise Applications
Locate the newly registered application
Select the "Properties" tab
Verify that "Enabled for users to sign-in" is set to "Yes"
If disabled, toggle the setting to "Yes" and save the changes
Step 3: Key Vault Configuration
Navigate to your existing Azure Key Vault, or create a new one:
If creating a new:
Go to Azure Portal > Key Vaults > Create
Select appropriate subscription and resource group
Choose a unique name for your key vault
Select the appropriate region
Choose your pricing tier
Complete the creation process
Configure access for the registered application using one of these methods:
Option A: Using RBAC (Recommended)
Navigate to the Key Vault's Access Control (IAM)
Click "Add" > "Add role assignment"
Search for and select "Key Vault Crypto Service Encryption User"
Assign it to the registered application
Option B: Using Access Policies
Navigate to the Key Vault's Access Policies
Click "Add Access Policy"
Configure the following permissions:
Key Management Operations:
Get
List
Update
Create
Import
Cryptographic Operations:
Unwrap Key
Wrap Key
4. Select the registered application as the principal
5. Save the changes
Step 4: Key Vault Configuration
In your Key Vault, navigate to the "Keys" section
Click "Generate/Import"
Provide the following details:
Name: Choose a meaningful name for your key
Key Type: RSA
RSA Key Size: 2048 (minimum)
Enabled: Yes
Click "Create"
5. Once created, click on the key and copy the "Key Identifier" URI
Step 5: Final Steps
Send the Key Identifier URI to your contact at Legora for configuration. The URI should look similar to:
FAQ
Q: How long does it take for the key to become active?
A: Once properly configured, the key becomes active immediately. However, allow up to 10 minutes for the encryption to propagate across all systems.
Q: Can I use an existing Key Vault?
A: Yes, you can use any existing Key Vault as long as it's in a supported region and the application has proper permissions.
Q: What happens if access to the key is lost?
A: If access to the encryption key is lost, data may become inaccessible. It's crucial to maintain proper access management and backup procedures.
Q: Can I rotate the encryption key?
A: Yes, both manual and automatic key rotation are supported. We use the latest available version of the key, so whenever a key is rotated, either manually or automatically, the new key will automatically be propagated by Azure. However, please allow up to a few hours for the key to be propagated correctly.
Q: What regions are supported?
A: CMEK is supported in all regions where Azure Key Vault is available. For optimal performance, we recommend a Key Vault location close to the Storage Account region (East US and Sweden Central for US/EU respectively).
Q: Can I use different keys for different storage accounts?
A: Yes, you can use different keys for different storage accounts, but each storage account can only use one key at a time.