Skip to content

Commit 2157bf4

Browse files
authored
Merge pull request #303459 from MicrosoftDocs/repo_sync_working_branch
Confirm merge from repo_sync_working_branch to main to sync with https://github.com/MicrosoftDocs/azure-docs (branch main)
2 parents 5540a98 + edec96f commit 2157bf4

File tree

1 file changed

+75
-13
lines changed

1 file changed

+75
-13
lines changed

articles/synapse-analytics/security/workspaces-encryption.md

Lines changed: 75 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ms.service: azure-synapse-analytics
99
ms.subservice: security
1010
ms.topic: conceptual
1111
---
12+
1213
# Encryption for Azure Synapse Analytics workspaces
1314

1415
This article will describe:
@@ -49,15 +50,80 @@ Workspaces can be configured to enable double encryption with a customer-managed
4950
5051
:::image type="content" source="media/workspaces-encryption/workspaces-encryption.png" alt-text="This diagram shows the option that must be selected to enable a workspace for double encryption with a customer-managed key." lightbox="media/workspaces-encryption/workspaces-encryption.png":::
5152

53+
## Prerequisites: Key Rotation and SQL Pool Status
54+
55+
> [!WARNING]
56+
> **Before changing the encryption key of your workspace:**
57+
>
58+
> - **Ensure all dedicated SQL pools are in the Online state.** Offline pools will not be re-encrypted and cannot resume if the old key or key version is deleted, disabled, or expired.
59+
> - **Retain all old keys and key versions** used for encryption until every SQL pool is brought online and re-encrypted with the new key. Only disable or delete the old key after all pools have successfully rotated to the new key.
60+
>
61+
> ⚠️ *Failure to follow these prerequisites may result in SQL pools being permanently inaccessible, or backup data becoming unrecoverable.*
62+
63+
**Key Rotation Checklist**
64+
65+
| Step | Action | Status |
66+
|------|---------------------------------------------------------------|--------|
67+
| 1 | Confirm all SQL pools are Online ||
68+
| 2 | Ensure old key is retained and enabled ||
69+
| 3 | Rotate CMK ||
70+
| 4 | Verify all pools are re-encrypted ||
71+
| 5 | Safely disable old key or key version (after all pools done) ||
72+
73+
## Key management best practices
74+
75+
> [!IMPORTANT]
76+
>
77+
> When changing the encryption key of a workspace, **retain the old key** until you have replaced it in the workspace with a new key. This allows decryption of data with the old key before it gets re-encrypted with the new key.
78+
>
79+
> The state of the SQL pool (**Online/Offline**) does **not** affect the workspace customer managed key (CMK) rotation process, but *offline pools will remain encrypted with the old key or key version*.
80+
>
81+
> If the old key or key version is disabled or expired, **offline pools will not resume** as decryption is not possible. Upon resuming these pools, the old key or key version must (1) be enabled and (2) have an expiration date set in the future to allow decryption and subsequent re-encryption with the new key or key version.
82+
>
83+
> **To ensure a smooth CMK rotation,** if some SQL pools are offline during the process, the old key or key version should remain enabled and have its expiration date set in the future. This is crucial until the offline pools are successfully resumed and re-encrypted with the new key or key version.
84+
>
85+
> **Do not delete old keys or key versions** until all pools and backups are successfully re-encrypted and validated. Only *disable* the old key after all requirements are met.
86+
87+
### Key Rotation Troubleshooting
88+
89+
If a SQL pool is stuck offline after a key rotation:
90+
91+
1. **Check the SQL pool key version** using PowerShell to confirm which key or key version the pool is expecting:
92+
93+
```powershell
94+
Get-AzSqlServerTransparentDataEncryptionProtector -ServerName 'ContosoServer' -ResourceGroupName 'WORKSPACE_MANAGED_RESOURCE_GROUP'
95+
```
96+
> [!NOTE]
97+
> The `ResourceGroupName` refers to the workspace's **managed resource group**. You can find this in the Azure portal by selecting your Synapse workspace and viewing the `managedResourceGroup` value in the JSON view.
98+
99+
2. **Enable** the required old key or key version in Azure Key Vault.
100+
3. **Set an expiration date** in the future for the old key or key version.
101+
4. Resume the SQL pool.
102+
5. Once the pool is back online, allow it to re-encrypt with the new key.
103+
6. **Verify the encryption status** of each database by running the following T-SQL query in your SQL pool:
104+
105+
```sql
106+
SELECT
107+
[name],
108+
[is_encrypted]
109+
FROM
110+
sys.databases;
111+
```
112+
113+
- The `is_encrypted` column will show the encryption status (`1` = encrypted, `0` = not encrypted).
114+
115+
7. After confirming all pools and backups are accessible and encrypted, you may safely disable (not delete) the old key or key version.
116+
52117
### Key access and workspace activation
53118
54119
The Azure Synapse encryption model with customer-managed keys involves the workspace accessing the keys in Azure Key Vault to encrypt and decrypt as needed. The keys are made accessible to the workspace either through an access policy or [Azure Key Vault RBAC](/azure/key-vault/general/rbac-guide). When granting permissions via an Azure Key Vault access policy, choose the ["Application-only"](/azure/key-vault/general/security-features#key-vault-authentication-options) option during policy creation (select the workspaces managed identity and do not add it as an authorized application).
55120
56-
The workspace managed identity must be granted the permissions it needs on the key vault before the workspace can be activated. This phased approach to workspace activation ensures that data in the workspace is encrypted with the customer-managed key. Encryption can be enabled or disabled for individual dedicated SQL Pools. Each dedicated pool is not enabled for encryption by default.
121+
The workspace managed identity must be granted the permissions it needs on the key vault before the workspace can be activated. This phased approach to workspace activation ensures that data in the workspace is encrypted with the customer-managed key. Encryption can be enabled or disabled for individual dedicated SQL Pools. Each dedicated pool is not enabled for encryption by default.
57122
58123
<a id="using-a-user-assigned-managed-identity"></a>
59124
60125
#### Use a User-assigned Managed identity
126+
61127
Workspaces can be configured to use a [User-assigned Managed identity](../../active-directory/managed-identities-azure-resources/overview.md) to access your customer-managed key stored in Azure Key Vault. Configure a User-assigned Managed identity to avoid phased activation of your Azure Synapse workspace when using double encryption with customer-managed keys. The Managed Identity Contributor built-in role is required to assign a user-assigned managed identity to an Azure Synapse workspace.
62128
63129
> [!NOTE]
@@ -79,25 +145,22 @@ If you do not configure a user-assigned managed identity to access customer mana
79145
80146
:::image type="content" source="media/workspaces-encryption/workspace-activation.png" alt-text="This diagram shows the banner with the activation link for the workspace." lightbox="media/workspaces-encryption/workspace-activation.png":::
81147
82-
83148
### Manage the workspace customer-managed key
84149
85150
You can change the customer-managed key used to encrypt data from the **Encryption** page in the Azure portal. Here too, you can choose a new key using a key identifier or select from Key Vaults that you have access to in the same region as the workspace. If you choose a key in a different key vault from the ones previously used, grant the workspace-managed identity "Get", "Wrap", and "Unwrap" permissions on the new key vault. The workspace will validate its access to the new key vault and all data in the workspace will be re-encrypted with the new key.
86151
87152
:::image type="content" source="media/workspaces-encryption/workspace-encryption-management.png" alt-text="This diagram shows the workspace Encryption section in the Azure portal." lightbox="media/workspaces-encryption/workspace-encryption-management.png":::
88153
89-
> [!IMPORTANT]
90-
>
91-
> When changing the encryption key of a workspace, retain the old key until you replace it in the workspace with a new key. This allows decryption of data with the old key before it gets re-encrypted with the new key.
92-
> The state of the SQL pool (Online/Offline) does not affect the workspace customer managed key (CMK) rotation process.
93-
>- SQL pools that are offline during the CMK rotation will remain encrypted with the old key or key version. If the old key or key version is disabled or expired, the pools will not resume as decryption is not possible. Upon resuming these pools, the old key or key version must 1) be enabled and 2) have an expiration date set in the future to allow decryption and subsequent re-encryption with the new key or key version.
94-
>
95-
>- To ensure a smooth CMK rotation, if some SQL pools are offline during the process, the old key or key version should remain enabled and have its expiration date set in the future. This is crucial until the offline pools are successfully resumed and re-encrypted with the new key or key version.
96-
>- It is highly recommended not to *delete* old keys or key versions, as they might still be needed to decrypt backups. Instead, after all SQL pools have been re-encrypted with the new key or key version, *disable* the old key or key version. This ensures the old key or key version remains available for decrypting older backups if necessary.
97-
98-
99154
Azure Key Vaults policies for automatic, periodic rotation of keys, or actions on the keys can result in the creation of new key versions. You can choose to re-encrypt all the data in the workspace with the latest version of the active key. To-re-encrypt, change the key in the Azure portal to a temporary key and then switch back to the key you wish to use for encryption. As an example, to update data encryption using the latest version of active key Key1, change the workspace customer-managed key to temporary key, Key2. Wait for encryption with Key2 to finish. Then switch the workspace customer-managed key back to Key1-data in the workspace will be re-encrypted with the latest version of Key1.
100155
156+
> [!NOTE]
157+
> **Key rotation is a three-step process:**
158+
> 1. Change the workspace customer-managed key from your **main key** to a **temporary key**.
159+
> 2. **Wait 15–30 minutes** for the re-encryption process to complete.
160+
> 3. Change the workspace customer-managed key back to your **main key** (now using the new version).
161+
>
162+
> This process ensures all workspace data is securely re-encrypted with the latest key version.
163+
101164
> [!NOTE]
102165
> Azure Synapse Analytics does not automatically re-encrypt data when new key versions are created. To ensure consistency in your workspace, force the re-encryption of data using the process detailed above.
103166
@@ -122,7 +185,6 @@ Use the following cmdlets for Azure Synapse workspace.
122185
| [Remove-AzSynapseWorkspaceKey](/powershell/module/az.synapse/remove-azsynapseworkspacekey) |Removes a Key Vault key from a workspace. |
123186
124187
125-
126188
## Related content
127189
128190
- [Use built-in Azure Policies to implement encryption protection for Synapse workspaces](../policy-reference.md)

0 commit comments

Comments
 (0)