An Azure service that is used to provision Windows and Linux virtual machines.
Hello @NS, wow, the question you've raised is truly quite complex and touches on advanced security architecture aspects within the Azure ecosystem. I'm answering based on my capabilities and experience in handling mission-critical infrastructure, where the integration between SQL Server, Extensible Key Management (EKM), and Azure Key Vault (AKV) is often a crucial point in data encryption strategies. In the context of Managed Identity (MI), the main challenge indeed lies in the rigid naming of credentials because it must match the FQDN (e.g., [contoso.vault.azure.net]). When you rotate keys, SQL Server still requires credential mapping to perform the "handshake" with AKV. Technically, a single MI credential can be mapped to multiple logins (whether it's the admin login performing the rotation or the new asymmetric login). However, what you need to underline is that SQL Server processes this as an authentication bridge; as long as the Managed Identity on the VM has get, wrapKey, and unwrapKey permissions on the Key Vault, that same single credential can be used simultaneously by various login entities within the SQL instance to access different key versions or new keys during the transition process.
Regarding the rotation procedure, to date there is no one-click automated runbook provided by Microsoft specifically for MI-based EKM as simple as on Azure SQL Database, because SQL Server on a VM is considered IaaS, giving full control (and full responsibility) to the administrator. The supported rotation process still follows a disciplined manual workflow: you must upload the new key version to AKV, create a new Asymmetric Key inside SQL Server referencing the new key URI (or its specific version), and then use the command ALTER DATABASE ENCRYPTION KEY SET ENCRYPTOR = ASYMMETRIC KEY [NewKeyName]. Regarding scheduled rotation recommendations, although SQL Server does not automatically update the TDE Protector, performing periodic rotation remains a highly recommended security best practice to mitigate the risk of long-term key compromise. You are advised to build an automation script (e.g., via Azure Automation or PowerShell inside the VM) that periodically executes the T-SQL command to ensure the Database Encryption Key (DEK) is always re-encrypted by the latest protector in AKV.
Finally, addressing the technical obstacle in the ALTER LOGIN ... ADD CREDENTIAL operation, if that operation fails when the credential is already mapped, this is usually not just a permission issue but also a design limitation where SQL Server prevents redundant double mapping or conflicts at the internal metadata level. If the credential [vaultname.vault.azure.net] already exists and is bound to the Managed Identity, you do not need to add it again to a new login if that login can inherit access through the existing credential mapping mechanism. However, if access failure occurs, ensure that the Service Principal of the Managed Identity has been explicitly granted access via Access Policy or RBAC in Azure Key Vault for the new key version. Failures often occur because "Key Permissions" have not been updated on the Azure side after the new key is created, not because of the T-SQL syntax itself. Technically, the key to successful rotation on MI-backed EKM is ensuring that the asymmetric key transition in SQL Server points to the correct AKV key version before you release dependency on the old key.
That's based on my experience and understanding. Hopefully it's useful and thank you 🙏.