Skip to content

Commit 2d762b0

Browse files
authored
Merge pull request #234263 from divargas-msft/patch-1
[Doc-a-thon] Updating quick-create-confidential-vm-arm-amd.md
2 parents f00edac + ee32806 commit 2d762b0

File tree

1 file changed

+43
-46
lines changed

1 file changed

+43
-46
lines changed

articles/confidential-computing/quick-create-confidential-vm-arm-amd.md

Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: virtual-machines
66
ms.subservice: confidential-computing
77
ms.workload: infrastructure
88
ms.topic: quickstart
9-
ms.date: 7/14/2022
9+
ms.date: 04/12/2023
1010
ms.author: RunCai
1111
ms.custom: mode-arm, devx-track-azurecli, devx-track-arm-template
1212
ms.devlang: azurecli
@@ -32,13 +32,13 @@ To create and deploy your confidential VM using an ARM template through the Azur
3232

3333
1. Sign in to your Azure account in the Azure CLI.
3434

35-
```azurecli
35+
```azurecli-interactive
3636
az login
3737
```
3838
3939
1. Set your Azure subscription. Replace `<subscription-id>` with your subscription identifier. Make sure to use a subscription that meets the [prerequisites](#prerequisites).
4040
41-
```azurecli
41+
```azurecli-interactive
4242
az account set --subscription <subscription-id>
4343
```
4444
@@ -55,15 +55,14 @@ To create and deploy your confidential VM using an ARM template through the Azur
5555
```
5656
5757
If the resource group you specified doesn't exist, create a resource group with that name.
58-
59-
```azurecli
58+
59+
```azurecli-interactive
6060
az group create -n $resourceGroup -l $region
6161
```
6262
6363
1. Deploy your VM to Azure using an ARM template with a custom parameter file
6464
65-
66-
```azurecli
65+
```azurecli-interactive
6766
az deployment group create `
6867
-g $resourceGroup `
6968
-n $deployName `
@@ -73,7 +72,6 @@ To create and deploy your confidential VM using an ARM template through the Azur
7372
vmName=$vmName
7473
```
7574
76-
7775
### Define custom parameter file
7876
7977
When you create a confidential VM through the Azure Command-Line Interface (Azure CLI), you need to define a custom parameter file. To create a custom JSON parameter file:
@@ -151,6 +149,9 @@ Use this example to create a custom parameter file for a Linux-based confidentia
151149
}
152150
```
153151

152+
> [!NOTE]
153+
> Replace the osImageName value accordingly.
154+
154155
## Deploy confidential VM template with OS disk confidential encryption via customer-managed key
155156

156157
1. Sign in to your Azure account through the Azure CLI.
@@ -161,83 +162,81 @@ Use this example to create a custom parameter file for a Linux-based confidentia
161162
162163
1. Set your Azure subscription. Replace `<subscription-id>` with your subscription identifier. Make sure to use a subscription that meets the [prerequisites](#prerequisites).
163164
164-
```azurecli
165+
```azurecli-interactive
165166
az account set --subscription <subscription-id>
166167
```
168+
167169
1. Grant confidential VM Service Principal `Confidential VM Orchestrator` to tenant
168170
169171
For this step you need to be a Global Admin or you need to have the User Access Administrator RBAC role.
170-
171-
```azurecli
172+
173+
```azurecli-interactive
172174
Connect-AzureAD -Tenant "your tenant ID"
173175
New-AzureADServicePrincipal -AppId bf7b6499-ff71-4aa2-97a4-f372087be7f0 -DisplayName "Confidential VM Orchestrator"
174176
```
177+
175178
1. Set up your Azure key vault. For how to use an Azure Key Vault Managed HSM instead, see the next step.
176179
177180
1. Create a resource group for your key vault. Your key vault instance and your confidential VM must be in the same Azure region.
178-
179-
```azurecli
181+
182+
```azurecli-interactive
180183
$resourceGroup = <key vault resource group>
181184
$region = <Azure region>
182185
az group create --name $resourceGroup --location $region
183186
```
184-
187+
185188
1. Create a key vault instance with a premium SKU in your preferred region.
186-
187-
```azurecli
189+
190+
```azurecli-interactive
188191
$KeyVault = <name of key vault>
189192
az keyvault create --name $KeyVault --resource-group $resourceGroup --location $region --sku Premium --enable-purge-protection
190193
```
191194
192195
1. Make sure that you have an **owner** role in this key vault.
193-
194196
1. Give `Confidential VM Orchestrator` permissions to `get` and `release` the key vault.
195-
196-
```azurecli
197+
198+
```azurecli-interactive
197199
$cvmAgent = az ad sp show --id "bf7b6499-ff71-4aa2-97a4-f372087be7f0" | Out-String | ConvertFrom-Json
198200
az keyvault set-policy --name $KeyVault --object-id $cvmAgent.objectId --key-permissions get release
199201
```
200202
201203
1. (Optional) If you don't want to use an Azure key vault, you can create an Azure Key Vault Managed HSM instead.
202204
203205
1. Follow the [quickstart to create an Azure Key Vault Managed HSM](../key-vault/managed-hsm/quick-create-cli.md) to provision and activate Azure Key Vault Managed HSM.
204-
205206
1. Enable purge protection on the Azure Managed HSM. This step is required to enable key release.
206207
207-
```azurecli
208+
```azurecli-interactive
208209
az keyvault update-hsm --subscription $subscriptionId -g $resourceGroup --hsm-name $hsm --enable-purge-protection true
209210
```
210211
211-
212212
1. Give `Confidential VM Orchestrator` permissions to managed HSM.
213-
214-
```azurecli
213+
214+
```azurecli-interactive
215215
$cvmAgent = az ad sp show --id "bf7b6499-ff71-4aa2-97a4-f372087be7f0" | Out-String | ConvertFrom-Json
216216
az keyvault role assignment create --hsm-name $hsm --assignee $cvmAgent.objectId --role "Managed HSM Crypto Service Release User" --scope /keys/$KeyName
217217
```
218218
219219
1. Create a new key using Azure Key Vault. For how to use an Azure Managed HSM instead, see the next step.
220220
221221
1. Prepare and download the [key release policy](https://cvmprivatepreviewsa.blob.core.windows.net/cvmpublicpreviewcontainer/skr-policy.json) to your local disk.
222-
223222
1. Create a new key.
224223
225-
```azurecli
224+
```azurecli-interactive
226225
$KeyName = <name of key>
227226
$KeySize = 3072
228227
az keyvault key create --vault-name $KeyVault --name $KeyName --ops wrapKey unwrapkey --kty RSA-HSM --size $KeySize --exportable true --policy "@.\skr-policy.json"
229228
```
230229
231230
1. Get information about the key that you created.
232-
233-
```azurecli
231+
232+
```azurecli-interactive
234233
$encryptionKeyVaultId = ((az keyvault show -n $KeyVault -g $resourceGroup) | ConvertFrom-Json).id
235234
$encryptionKeyURL= ((az keyvault key show --vault-name $KeyVault --name $KeyName) | ConvertFrom-Json).key.kid
236235
```
237-
236+
238237
1. Deploy a Disk Encryption Set (DES) using a [DES ARM template](https://cvmprivatepreviewsa.blob.core.windows.net/cvmpublicpreviewcontainer/deploymentTemplate/deployDES.json) (`deployDES.json`).
239238
240-
```azurecli
239+
```azurecli-interactive
241240
$desName = <name of DES>
242241
$deployName = <name of deployment>
243242
$desArmTemplate = <name of DES ARM template file>
@@ -253,7 +252,7 @@ Use this example to create a custom parameter file for a Linux-based confidentia
253252
254253
1. Assign key access to the DES file.
255254
256-
```azurecli
255+
```azurecli-interactive
257256
$desIdentity= (az disk-encryption-set show -n $desName -g
258257
$resourceGroup --query [identity.principalId] -o tsv)
259258
az keyvault set-policy -n $KeyVault `
@@ -263,26 +262,24 @@ Use this example to create a custom parameter file for a Linux-based confidentia
263262
```
264263
265264
1. (Optional) Create a new key from an Azure Managed HSM.
266-
267265
1. Prepare and download the [key release policy](https://cvmprivatepreviewsa.blob.core.windows.net/cvmpublicpreviewcontainer/skr-policy.json) to your local disk.
268-
269266
1. Create the new key.
270267
271-
```azurecli
268+
```azurecli-interactive
272269
$KeyName = <name of key>
273270
$KeySize = 3072
274271
az keyvault key create --hsm-name $hsm --name $KeyName --ops wrapKey unwrapkey --kty RSA-HSM --size $KeySize --exportable true --policy "@.\skr-policy.json"
275272
```
276273
277274
1. Get information about the key that you created.
278-
279-
```azurecli
275+
276+
```azurecli-interactive
280277
$encryptionKeyURL = ((az keyvault key show --hsm-name $hsm --name $KeyName) | ConvertFrom-Json).key.kid
281278
```
282-
279+
283280
1. Deploy a DES.
284281
285-
```azurecli
282+
```azurecli-interactive
286283
$desName = <name of DES>
287284
az disk-encryption-set create -n $desName `
288285
-g $resourceGroup `
@@ -291,7 +288,7 @@ Use this example to create a custom parameter file for a Linux-based confidentia
291288
292289
1. Assign key access to the DES.
293290
294-
```azurecli
291+
```azurecli-interactive
295292
desIdentity=$(az disk-encryption-set show -n $desName -g $resourceGroup --query [identity.principalId] -o tsv)
296293
az keyvault set-policy -n $hsm `
297294
-g $resourceGroup `
@@ -300,16 +297,16 @@ Use this example to create a custom parameter file for a Linux-based confidentia
300297
```
301298
302299
1. Deploy your confidential VM with the customer-managed key.
303-
300+
304301
1. Get the resource ID for the DES.
305302
306-
```azurecli
303+
```azurecli-interactive
307304
$desID = (az disk-encryption-set show -n $desName -g $resourceGroup --query [id] -o tsv)
308305
```
309-
306+
310307
1. Deploy your confidential VM using the [confidential VM ARM template](https://cvmprivatepreviewsa.blob.core.windows.net/cvmpublicpreviewcontainer/deploymentTemplate/deployCPSCVM_cmk.json) (`deployCPSCVM_cmk.json`) and a [deployment parameter file](#example-deployment-parameter-file) (for example, `azuredeploy.parameters.win2022.json`) with the customer-managed key.
311-
312-
```azurecli
308+
309+
```azurecli-interactive
313310
$deployName = <name of deployment>
314311
$vmName = <name of confidential VM>
315312
$cvmArmTemplate = <name of confidential VM ARM template file>
@@ -325,7 +322,7 @@ Use this example to create a custom parameter file for a Linux-based confidentia
325322
```
326323
327324
1. Connect to your confidential VM to make sure the creation was successful.
328-
325+
329326
### Example deployment parameter file
330327
331328
This is an example parameter file for a Windows Server 2022 Gen 2 confidential VM:
@@ -356,7 +353,7 @@ This is an example parameter file for a Windows Server 2022 Gen 2 confidential V
356353
}
357354
}
358355
}
359-
```
356+
```
360357

361358
## Next steps
362359

0 commit comments

Comments
 (0)