Invalid Azure Key Vault key path specified

Velayutham P 1 Reputation point
2022-11-16T16:56:37.993+00:00

Failed to decrypt a column encryption key using key store provider: 'AZURE_KEY_VAULT'. Verify the properties of the column encryption key and its column master key in your database. The last 10 bytes of the encrypted column encryption key are: 'XX-XX-XX-XX-F8-10-F6-00-EA-9D'.
Invalid Azure Key Vault key path specified: 'https://xxxxxxxxxxxxxxxxxxx.vault.azure.net/keys/cutomekey/xxxxxxxxxxxxxxxxxx'. Valid trusted endpoints: https://xxxxxxxxxxxxxxxxx.vault.azure.net/. (Parameter 'masterKeyPath') Invalid Azure Key Vault key path specified: ''https://xxxxxxxxxxxxxxxxxxx.vault.azure.net/keys/cutomekey/xxxxxxxxxxxxxxxxxx'.'. Valid trusted endpoints: https://xxxxxxxxxxxxx.vault.azure.net/. (Parameter 'masterKeyPath')

I am getting above error when decrypt the column through code (.net core 3.2).

The decryption working when decrypt through SSMS(Microsoft Management Studio).

The Key stored in keyvault is custom managed key.

And enable managed identity between keyvault and appservice.

but i dont know why this is not working. its worked few months back!

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,448 questions
Azure SQL Database
Microsoft Security Microsoft Entra Microsoft Entra ID
Developer technologies .NET Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SSingh-MSFT 16,371 Reputation points Moderator
    2022-11-17T16:23:06.29+00:00

    Hi @Velayutham P ,

    Welcome to Microsoft Q&A platform and thanks for using Azure Services.

    As I understand from the Error, Invalid Azure Key Vault key path specified.

    It could be related with the Azure key vault firewall. The member who wants to 'decrypt' the data should whitelisted their IP address in Azure key vault.

    Try to check permissions too. In order to completely verify that you have the correct permissions, go to Key Vault Blade:

    • Select Access Policies from the Key Vault resource blade menu on the left
    • Click the "add new" link/button at the top
    • Select Principal to select the application that you are using (i.e. the app registration from which you got the client ID from)
    • From the Key permissions drop down, make sure you give it "Decrypt", "Sign", "Get", "UnwrapKey" permissions
    • Make sure to save changes

    Lastly - you have to make sure your app registration has the correct permissions for your subscription.

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.
      Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification

Your answer

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