Share via

Cannot restore SQL Flexible Server

James Kester 21 Reputation points
2023-07-19T17:28:35.89+00:00

I am attempting to do a fast restore on my Azure SQL flexible server. I have created a Managed user, and I have a key vault with a new key created. The keyvault has no firewall setting and is open to the public. After going through all of the restore steps, it errors on deployment with the following:

What am I missing? ( I have tried this 5 times)

Could not find Azure Key Vault Key with key name 'https://abnskeyvault.vault.azure.net/keys/sqlrestorekey/3dee0bf95cfc49ad8d05a58e955c8306'. (Code: AzureKeyVaultKeyNotFound)

Azure SQL Database

Answer accepted by question author

B santhiswaroop naik 405 Reputation points
2023-07-19T18:19:29.77+00:00

--please don't forget to upvote and Accept as answer if the reply is helpful--

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. James Kester 21 Reputation points
    2023-07-19T18:16:04.0266667+00:00

    Ah! the original SQL server did not have a managed user associated with it. The UI leads you to believe you need to select a managed user as there is no other option. I tried again by ignoring that step and it deployed.

    Was this answer helpful?

    0 comments No comments

  2. B santhiswaroop naik 405 Reputation points
    2023-07-19T17:35:23.02+00:00

    The error message "Could not find Azure Key Vault Key with key name 'https://abnskeyvault.vault.azure.net/keys/sqlrestorekey/3dee0bf95cfc49ad8d05a58e955c8306'. (Code: AzureKeyVaultKeyNotFound)" suggests that there might be an issue with the key vault configuration or permissions. Let's go through the steps to troubleshoot and resolve the problem:

    Verify Key Vault URL and Key Name: Ensure that the key vault URL and the key name used in the restore process are correct and match the actual names in the Azure portal. Make sure there are no typos or extra spaces in the URL or key name.

    Check Key Vault Access Policy: Confirm that the Managed User (user-assigned managed identity) associated with your Azure SQL flexible server has the appropriate access to the Azure Key Vault. The managed user should have the "Get" permission for keys in the key vault to be able to retrieve the key during the restore process.

    Check Key Version: The key vault key URL provided during the restore process includes a version ID (e.g., "3dee0bf95cfc49ad8d05a58e955c8306"). Ensure that this specific version of the key exists in the key vault. If the key version mentioned in the URL doesn't exist, you may need to specify the correct version ID.

    Verify Key Vault Firewall Settings: Although you mentioned that the key vault has no firewall settings and is open to the public, it's still worth double-checking the firewall settings in the Azure portal to ensure that there are no restrictions preventing access to the key vault.

    Inspect Azure SQL Server Identity Settings: Check the Azure SQL flexible server configuration to ensure that the Managed User (Managed Identity) is correctly associated with the server. Make sure the correct identity is selected in the server's "Identity" settings.

    Retry with Different Key Vault or Key: If the issue persists, try using a different key vault or create a new key within the key vault. There might be an issue specific to the key or key vault that you are using.

    Review Azure SQL Restore Parameters: Review the parameters used during the fast restore process, including the key vault URL and key name. Ensure that the restore parameters are correctly specified.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.