Terraform Customer Managed Key for Storage Account storage.AccountsClient#Update: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code=KeyVaultAuthenticationFailure

Jeeva 6 Reputation points
2022-07-25T22:29:33.933+00:00

I am trying to create a storage account with CMK and using a user-assigned managed identity. The Terraform script I am using looks correct but running it throws this error and not sure why. The error message is not clear. I uploaded my tf file here for debugging.

If we assigned both "UserAssigned" and "SystemAssigned" as identities to a storage account which one is used for performing the encryption. What is the user for having both types of identities assigned to a storage account encryption?

If we assign a "UserAssigned" Identity, then this identity should have access to get/wrap/unwrap the encryption key from the vault (thru vault policies). Is this enough for this use case. Is there any additional permission given to the storage account?

224560-main.txt

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,112 questions
{count} vote

2 answers

Sort by: Most helpful
  1. VIVEK DWIVEDI 25 Reputation points
    2023-01-15T17:11:42.9366667+00:00

    I have the same issue, the only difference is I am using a system-assigned identity and on the key vault, access is through RBAC. The key vault key officer role is granted to system-managed identity, which is verified too.

    It is not yet solved.

    0 comments No comments

  2. Viral 0 Reputation points
    2023-03-15T19:17:31.6733333+00:00

    I'm having same issue, as there been any movement on this?

    0 comments No comments