Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
Hi Bharath Mohan,
Thanks for reaching out in Microsoft Q&A forum,
I am getting storage account is not authorized to connect to key vault message.
When you try to change the storage account encryption to use customer‑managed keys (CMK) and run into an “authentication issue,” it usually means that the storage account’s managed identity is not allowed to authenticate to the key vault. This can happen even if the key vault, key, and identity exist, because the permissions or identity linkage are not configured correctly. The error is Azure’s way of saying “this storage account is not authorized to use the key from that vault.”
In practice, the CMK‑setup flow is simple but strict: the storage account must have a managed identity, the key vault must be enabled for CMK use, and that identity must be granted explicit cryptographic permissions on the key vault (via Azure RBAC or access policies). If any of these pieces is missing or mis‑aligned such as assigning the role to a different identity or forgetting to enable soft delete on the vaultthe operation will fail with an authentication‑like error.
Check the below steps in your environment:
- Enable a managed identity on the storage account
- Turn System‑assigned identity to On, or assign a User‑assigned managed identity on the storage account. This identity is what Azure uses to call the key vault on your behalf.
- Prepare the key vault for CMK
- Ensure the key vault has soft delete and purge protection enabled, which is a hard requirement for CMK‑enabled storage accounts.
- Grant the right permissions on the key vault
- If the key vault uses Azure RBAC:
- In Access control (IAM), assign the
Key Vault Crypto Service Encryption Userrole to the storage account (for system‑assigned) or to the user‑assigned identity. This role allows the identity to read key metadata and perform wrap/unwrap operations.
- In Access control (IAM), assign the
- If the key vault uses Access policies (legacy):
- Add an Access policy entry for the storage account’s managed identity and grant Get, Wrap Key, and Unwrap Key permissions on keys.
- If the key vault uses Azure RBAC:
- Check network and identity alignment
- If the key vault is behind a firewall or private endpoint, ensure that trusted Microsoft services can reach it (for example, by enabling “Allow trusted Microsoft services”).
- Verify that the identity you see in the storage account’s Identity blade is the exact one that has the role assigned; mismatched identities are a common cause of this error.
- Re‑apply the CMK configuration cleanly
- Temporarily switch the storage account back to Microsoft‑managed keys, then re‑enable CMK after a short wait so the updated permissions and identity state can propagate.
- In templates (ARM/Bicep/Terraform), ensure the identity is created and enabled before you try to configure CMK; interleaving these steps can trigger transient authentication‑style failures.
Reference:
- https://learn.microsoft.com/en-us/azure/storage/common/customer-managed-keys-overview
- https://learn.microsoft.com/en-us/azure/key-vault/general/rbac-guide
- https://learn.microsoft.com/en-us/azure/storage/common/customer-managed-keys-configure-new-account?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&bc=%2Fazure%2Fstorage%2Fblobs%2Fbreadcrumb%2Ftoc.json&tabs=azure-portal
- https://stackoverflow.com/questions/65074590/not-able-to-apply-cmk-encryption-to-azure-storage-account-through-arm-template
Kindly let us know if the above helps or you need further assistance on this issue.
Please do not forget to
and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.