|
| 1 | +--- |
| 2 | +title: Data encryption for Azure Database for PostgreSQL - Single server troubleshooting |
| 3 | +description: Learn how to troubleshoot the data encryption for your Azure Database for PostgreSQL - Single server |
| 4 | +author: kummanish |
| 5 | +ms.author: manishku |
| 6 | +ms.service: postgresql |
| 7 | +ms.topic: conceptual |
| 8 | +ms.date: 02/13/2020 |
| 9 | +--- |
| 10 | + |
| 11 | +# Troubleshooting data encryption with customer-managed keys in Azure Database for PostgreSQL - Single server |
| 12 | +This article describes how to identify and resolve common issues/errors that occur on an Azure Database for PostgreSQL - Single server configured with Data Encryption using customer-managed key. |
| 13 | + |
| 14 | +## Introduction |
| 15 | +When data encryption is configured to use a customer-managed key in Azure Key Vault, continuous access to this key is required for the server to stay available. If the server loses access to the customer-managed key in Azure Key Vault, the server will start denying all connections with the appropriate error message and change its state to ***Inaccessible*** in the Azure portal. |
| 16 | + |
| 17 | +If an inaccessible Azure Database for PostgreSQL - Single server is no longer needed, it can be deleted immediately to stop incurring costs. All other actions on the server are not permitted until access to the Azure key vault has been restored and the server is back available. Changing the data encryption option from ‘Yes’(customer-managed) to ‘No’ (service-managed) on an inaccessible the server is also not possible while a server is encrypted with customer-managed. You must revalidate the key manually to make the server back available. This is necessary to protect the data from unauthorized access while permissions to the customer-managed key have been revoked. |
| 18 | + |
| 19 | +## Common errors causing server to become inaccessible |
| 20 | + |
| 21 | +Most issues that occur when you use data encryption with Azure Key Vault are caused by one of the following misconfigurations- |
| 22 | + |
| 23 | +The key vault is unavailable or doesn't exist |
| 24 | + |
| 25 | +* The key vault was accidentally deleted. |
| 26 | +* An intermittent network error causes the key vault to be unavailable. |
| 27 | + |
| 28 | +No permissions to access the key vault or the key doesn't exist |
| 29 | + |
| 30 | +* The key was accidentally deleted, disabled or the key expired. |
| 31 | +* The Azure Database for PostgreSQL - Single server instance-managed identity was accidentally deleted. |
| 32 | +* Permissions granted to the Azure Database for PostgreSQL managed identity for the keys aren't sufficient (they don't include Get, Wrap, and Unwrap). |
| 33 | +* Permissions for the Azure Database for PostgreSQL Single server instance-managed identity were revoked or deleted. |
| 34 | + |
| 35 | +## Identify and resolve common errors |
| 36 | +### Errors on the key vault |
| 37 | + |
| 38 | +#### Disabled key vault |
| 39 | +* AzureKeyVaultKeyDisabledMessage |
| 40 | +* **Explanation** : The operation could not be completed on server because the Azure Key Vault key is disabled. |
| 41 | + |
| 42 | +#### Missing key vault permissions |
| 43 | +* AzureKeyVaultMissingPermissionsMessage |
| 44 | +* The server does not have the required Get, Wrap, and Unwrap permissions to the Azure Key Vault permissions. Grant any missing permissions to the service principal with ID. |
| 45 | + |
| 46 | +### Mitigation |
| 47 | +* Confirm that the customer-managed key is present in Key Vault: |
| 48 | +* Identify the key vault, then go to the key vault in the Azure portal. |
| 49 | +* Ensure that the key identified by the key URI is present. |
| 50 | + |
| 51 | + |
| 52 | +## Next steps |
| 53 | +[Set up data encryption with a customer-managed key for your Azure database for PostgreSQL by using the Azure portal](howto-data-encryption-portal.md). |
0 commit comments