Skip to content

Commit c66831a

Browse files
authored
Update quick-create-confidential-vm-azure-cli-amd.md
Adding in VM Orchestrator steps
1 parent 5fa1421 commit c66831a

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

articles/confidential-computing/quick-create-confidential-vm-azure-cli-amd.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,31 +84,42 @@ Make a note of the `publicIpAddress` to use later.
8484

8585
Create a confidential [disk encryption set](../virtual-machines/linux/disks-enable-customer-managed-keys-cli.md) using [Azure Key Vault](../key-vault/general/quick-create-cli.md) or [Azure Key Vault managed Hardware Security Module (HSM)](../key-vault/managed-hsm/quick-create-cli.md). Based on your security and compliance needs you can choose either option. The following example uses Azure Key Vault Premium.
8686

87-
1. Create an Azure Key Vault using the [az keyvault create](/cli/azure/keyvault) command. For the pricing tier, select Premium (includes support for HSM backed keys). Make sure that you have an owner role in this key vault.
87+
1. Grant confidential VM Service Principal `Confidential VM Orchestrator` to tenant
88+
For this step you need to be a Global Admin or you need to have the User Access Administrator RBAC role.
89+
```azurecli
90+
Connect-AzureAD -Tenant "your tenant ID"
91+
New-AzureADServicePrincipal -AppId bf7b6499-ff71-4aa2-97a4-f372087be7f0 -DisplayName "Confidential VM Orchestrator"
92+
```
93+
2. Create an Azure Key Vault using the [az keyvault create](/cli/azure/keyvault) command. For the pricing tier, select Premium (includes support for HSM backed keys). Make sure that you have an owner role in this key vault.
8894
```azurecli-interactive
8995
az keyvault create -n keyVaultName -g myResourceGroup --enabled-for-disk-encryption true --sku premium --enable-purge-protection true
9096
```
91-
2. Create a key in the key vault using [az keyvault key create](/cli/azure/keyvault). For the key type, use RSA-HSM.
97+
3. Give `Confidential VM Orchestrator` permissions to `get` and `release` the key vault.
98+
```azurecli
99+
$cvmAgent = az ad sp show --id "bf7b6499-ff71-4aa2-97a4-f372087be7f0" | Out-String | ConvertFrom-Json
100+
az keyvault set-policy --name $KeyVault --object-id $cvmAgent.objectId --key-permissions get release
101+
```
102+
4. Create a key in the key vault using [az keyvault key create](/cli/azure/keyvault). For the key type, use RSA-HSM.
92103
```azurecli-interactive
93104
az keyvault key create --name mykey --vault-name keyVaultName --default-cvm-policy --exportable --kty RSA-HSM
94105
```
95-
3. Create the disk encryption set using [az disk-encryption-set create](/cli/azure/disk-encryption-set). Set the encryption type to `ConfidentialVmEncryptedWithCustomerKey`.
106+
5. Create the disk encryption set using [az disk-encryption-set create](/cli/azure/disk-encryption-set). Set the encryption type to `ConfidentialVmEncryptedWithCustomerKey`.
96107
```azurecli-interactive
97108
$keyVaultKeyUrl=(az keyvault key show --vault-name keyVaultName --name mykey--query [key.kid] -o tsv)
98109
99110
az disk-encryption-set create --resource-group myResourceGroup --name diskEncryptionSetName --key-url $keyVaultKeyUrl --encryption-type ConfidentialVmEncryptedWithCustomerKey
100111
```
101-
4. Grant the disk encryption set resource access to the key vault using [az key vault set-policy](/cli/azure/keyvault).
112+
6. Grant the disk encryption set resource access to the key vault using [az key vault set-policy](/cli/azure/keyvault).
102113
```azurecli-interactive
103114
$desIdentity=(az disk-encryption-set show -n diskEncryptionSetName -g myResourceGroup --query [identity.principalId] -o tsv)
104115
105116
az keyvault set-policy -n keyVaultName -g myResourceGroup --object-id $desIdentity --key-permissions wrapkey unwrapkey get
106117
```
107-
5. Use the disk encryption set ID to create the VM.
118+
7. Use the disk encryption set ID to create the VM.
108119
```azurecli-interactive
109120
$diskEncryptionSetID=(az disk-encryption-set show -n diskEncryptionSetName -g myResourceGroup --query [id] -o tsv)
110121
```
111-
6. Create a VM with the [az vm create](/cli/azure/vm) command. Choose `DiskWithVMGuestState` for OS disk confidential encryption with a customer-managed key. Enabling secure boot is optional, but recommended. For more information, see [secure boot and vTPM](../virtual-machines/trusted-launch.md). For more information on disk encryption, see [confidential OS disk encryption](confidential-vm-overview.md).
122+
8. Create a VM with the [az vm create](/cli/azure/vm) command. Choose `DiskWithVMGuestState` for OS disk confidential encryption with a customer-managed key. Enabling secure boot is optional, but recommended. For more information, see [secure boot and vTPM](../virtual-machines/trusted-launch.md). For more information on disk encryption, see [confidential OS disk encryption](confidential-vm-overview.md).
112123

113124
```azurecli-interactive
114125
az vm create \
@@ -186,4 +197,4 @@ echo -n $JWT | cut -d "." -f 2 | base64 -d 2>/dev/null | jq .
186197
## Next steps
187198

188199
> [!div class="nextstepaction"]
189-
> [Create a confidential VM on AMD with an ARM template](quick-create-confidential-vm-arm-amd.md)
200+
> [Create a confidential VM on AMD with an ARM template](quick-create-confidential-vm-arm-amd.md)

0 commit comments

Comments
 (0)