You are developing a C# console application that runs on an Azure Virtual Machine. The application must perform key wrapping and unwrapping operations using an RSA key stored in an Azure Key Vault named kv-prod-keys. The Key Vault is configured to use the Azure Role-Based Access Control (Azure RBAC) permission model. The virtual machine has a system-assigned managed identity enabled. You need to grant the application the minimum necessary permissions to perform the operations and configure the application code using the latest Azure SDK for .NET. Which two actions should you perform? (Select TWO.)
- Assign the Key Vault Crypto User role to the system-assigned managed identity of the virtual machine.Answer
- Instantiate the CryptographyClient class from the Azure.Security.KeyVault.Keys.Cryptography namespace.Answer
- CAssign the Key Vault Secrets User role to the system-assigned managed identity of the virtual machine.
- DCreate a Key Vault access policy that grants Key Wrap and Key Unwrap permissions to the system-assigned managed identity.
- EConfigure a user-assigned managed identity on the virtual machine and assign it the Reader role on the Key Vault resource.
Answer
Assign the Key Vault Crypto User role to the system-assigned managed identity and use the CryptographyClient class from the Azure.Security.KeyVault.Keys.Cryptography namespace.
To perform cryptographic operations such as key wrapping and unwrapping using an RSA key in Azure Key Vault, the application identity requires the 'Key Vault Crypto User' RBAC role, which provides data plane access for keys. In the Azure SDK for .NET (Azure.Security.KeyVault), cryptographic operations are separated from management operations and must be executed using the 'CryptographyClient' class located in the 'Azure.Security.KeyVault.Keys.Cryptography' namespace.
Step-by-Step Solution
Key Concept
Azure Key Vault cryptographic operations and RBAC-based access control using the Azure SDK for .NET.