Skip to content

Commit 990545f

Browse files
authored
Restored Example 9 and added CVM as Example 13. (#20092)
* Restored Example 9 and added CVM as Example 13. Related to #1222, example 9 was replaced with CVM content. Restored original Example 9 and added new Example 13 for Confidential VM support. * Minor correction of Location name under example 13 * Corrected EncryptedWithCMK String
1 parent e2ec636 commit 990545f

File tree

1 file changed

+35
-10
lines changed

1 file changed

+35
-10
lines changed

src/Compute/Compute/help/New-AzGalleryImageVersion.md

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,17 @@ $galleryImageVersionName = "1.0.0"
156156
$location = "eastus"
157157
158158
$sourceImageId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myVMRG/providers/Microsoft.Compute/virtualMachines/myVM"
159-
$diskEncryptionSetId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myVMRG/providers/Microsoft.Compute/diskEncryptionSets/cvmDiskEncryptionSet"
160-
161-
$cvmOsDiskEncryption = @{CVMEncryptionType=EncryptedWithCmk; CVMDiskEncryptionSetID=$diskEncryptionSetId}
162-
163-
$cvmDataDiskEncryption_lun0 = @{DiskEncryptionSetId = $diskEncryptionSetId ; Lun = 0}
164-
$cvmDataDiskEncryption = @($cvmDataDiskEncryption_lun0)
159+
$replicaCount = 1
160+
$storageAccountType = "Standard_ZRS"
165161
166-
$cvmEncryption = @{OSDiskImage = $cvmOsDiskEncryption; DataDiskImages = $cvmDataDiskEncryption}
167-
$region_eastus = @{Name = 'East US';ReplicaCount = 3;StorageAccountType = 'Standard_LRS'; Encryption = $cvmEncryption}
162+
$region_eastus = @{Name = 'East US';ReplicaCount = 3;StorageAccountType = 'Standard_LRS'}
163+
$region_westus = @{Name = 'West US'}
168164
$region_ukwest = @{Name = 'UK West';ReplicaCount = 2}
169-
$targetRegions = @($region_eastus, $region_ukwest)
165+
$region_southcentralus = @{Name = 'South Central US';StorageAccountType = 'Standard_LRS'}
170166
171-
New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -SourceImageId $sourceImageId -ReplicaCount 1 -StorageAccountType "Standard_ZRS" -TargetRegion $targetRegions
167+
$targetRegions = @($region_eastus, $region_westus, $region_ukwest, $region_southcentralus)
168+
169+
New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -SourceImageId $sourceImageId -ReplicaCount 1 -StorageAccountType $storageAccountType -TargetRegion $targetRegions
172170
```
173171

174172
Create an image version in four regions. In this example, the global replica count is 1 and the global storage account type is Standard_ZRS. East US will have 3 replicas, each stored on Standard_LRS account storage. West US will inherit from global settings and have 1 replica stored on Standard_ZRS. UK West will have a replica count of 2 stored on Standard_ZRS. South Central US will have one replica stored on Standard_LRS.
@@ -235,6 +233,33 @@ New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -
235233

236234
This example has the end-of-life date for image version set to August 2, 2024 at mignight UTC. End-of-life dates can be specified for both the image definitions and image versions. Image versions can still be used after the end-of-life dates.
237235

236+
### Example 13: Create an image version for Confidential VM
237+
238+
```powershell
239+
$rgName = "myResourceGroup"
240+
$galleryName = "myGallery"
241+
$galleryImageDefinitionName = "cvmImage"
242+
$galleryImageVersionName = "1.0.0"
243+
$location = "North Europe"
244+
245+
$sourceImageId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myVMRG/providers/Microsoft.Compute/virtualMachines/myVM"
246+
$cvmDiskEncryptionSetId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myVMRG/providers/Microsoft.Compute/diskEncryptionSets/cvmDiskEncryptionSet"
247+
$dataDiskEncryptionSetId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myVMRG/providers/Microsoft.Compute/diskEncryptionSets/dataDiskEncryptionSet"
248+
249+
$cvmOsDiskEncryption = @{CVMEncryptionType='EncryptedWithCmk'; CVMDiskEncryptionSetID=$cvmDiskEncryptionSetId}
250+
251+
$cvmDataDiskEncryption_lun0 = @{DiskEncryptionSetId = $dataDiskEncryptionSetId ; Lun = 0}
252+
$cvmDataDiskEncryption = @($cvmDataDiskEncryption_lun0)
253+
254+
$cvmEncryption = @{OSDiskImage = $cvmOsDiskEncryption; DataDiskImages = $cvmDataDiskEncryption}
255+
$region_northEurope = @{Name = 'NorthEurope';ReplicaCount = 3;StorageAccountType = 'Standard_LRS'; Encryption = $cvmEncryption}
256+
$targetRegions = @($region_northEurope)
257+
258+
New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -SourceImageId $sourceImageId -ReplicaCount 1 -StorageAccountType "Standard_LRS" -TargetRegion $targetRegions
259+
```
260+
261+
In this example, Confidential VM (CVM) Image with Customer Managed Key (CMK) is created under Image definition which supports ConfidentialVM security type.
262+
238263
## PARAMETERS
239264

240265
### -AsJob

0 commit comments

Comments
 (0)