Skip to content

Commit 4a82d5f

Browse files
grizzlytheodoreTheodore Changisra-fel
authored
gallery Confidential VM feature (#19359)
* update sdk package * implement * suppress breaking change * update md file and changelog * Fix ps730previewbug (#19351) * update sdk package * suppress breaking change Co-authored-by: Theodore Chang <[email protected]> * Update src/RecoveryServices/RecoveryServices.SiteRecovery.Test/RecoveryServices.SiteRecovery.Test.csproj * suppress example issues * fix example issues * example and changelog Co-authored-by: Theodore Chang <[email protected]> Co-authored-by: Yeming Liu <[email protected]>
1 parent d7c6339 commit 4a82d5f

File tree

5 files changed

+42
-3
lines changed

5 files changed

+42
-3
lines changed

src/Compute/Compute/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* Improved printed output for `Get-AzComputeResourceSku`
2828
* Updated `Update-AzVm` to give constructive error messages when empty variables are passed in parameters. [#15081]
2929
* Added `Zone` and `IntentVMSizeList` optional parameters to the cmdlet `New-AzProximityPlacementGroup`.
30+
* For `New-AzGalleryImageVersion`, `CVMEncryptionType` and `CVMDiskEncryptionSetID` added as keys for parameter `-Target`.
3031

3132
## Version 4.30.0
3233
* Added parameters `PackageFileName`, `ConfigFileName` for `New-AzGalleryApplicationVersion`

src/Compute/Compute/Generated/GalleryImageVersion/GalleryImageVersionCreateOrUpdateMethod.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,34 @@ public override void ExecuteCmdlet()
147147
target.Encryption = new EncryptionImages(osDiskImageEncryption, dataDiskImageEncryption);
148148
}
149149

150+
if (t["CVMEncryptionType"] != null)
151+
{
152+
if (target.Encryption == null)
153+
{
154+
target.Encryption = new EncryptionImages();
155+
}
156+
target.Encryption.OsDiskImage = new OSDiskImageEncryption();
157+
target.Encryption.OsDiskImage.SecurityProfile = new OSDiskImageSecurityProfile();
158+
target.Encryption.OsDiskImage.SecurityProfile.ConfidentialVMEncryptionType = (string)t["CVMEncryptionType"];
159+
}
160+
161+
if (t["CVMDiskEncryptionSetID"] != null)
162+
{
163+
if (target.Encryption == null)
164+
{
165+
target.Encryption = new EncryptionImages();
166+
}
167+
if (target.Encryption.OsDiskImage == null)
168+
{
169+
target.Encryption.OsDiskImage = new OSDiskImageEncryption();
170+
}
171+
if (target.Encryption.OsDiskImage.SecurityProfile == null)
172+
{
173+
target.Encryption.OsDiskImage.SecurityProfile = new OSDiskImageSecurityProfile();
174+
}
175+
target.Encryption.OsDiskImage.SecurityProfile.SecureVMDiskEncryptionSetId = (string)t["CVMDiskEncryptionSetID"];
176+
}
177+
150178
galleryImageVersion.PublishingProfile.TargetRegions.Add(target);
151179
}
152180
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
external help file: Microsoft.Azure.PowerShell.Cmdlets.Compute.dll-Help.xml
33
Module Name: Az.Compute
44
online version: https://docs.microsoft.com/powershell/module/az.compute/new-azgalleryimagedefinition
@@ -91,7 +91,8 @@ $skuName = "GreatSku"
9191
$description = "My gallery"
9292
$IsHibernateSupported = @{Name='IsHibernateSupported';Value='True'}
9393
$IsAcceleratedNetworkSupported = @{Name='IsAcceleratedNetworkSupported';Value='False'}
94-
$features = @($IsHibernateSupported,$IsAcceleratedNetworkSupported)
94+
$ConfidentialVMSupported = @{Name='SecurityType';Value='ConfidentialVMSupported'}
95+
$features = @($IsHibernateSupported,$IsAcceleratedNetworkSupported, $ConfidentialVMSupported)
9596
New-AzGalleryImageDefinition -ResourceGroupName $rgName -GalleryName $galleryName -Name $galleryImageDefinitionName -Location $location -Publisher $publisherName -Offer $offerName -Sku $skuName -OsState "Generalized" -OsType "Windows" -Description $description -Feature $features
9697
```
9798

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,10 @@ $galleryImageDefinitionName = "myImage"
155155
$galleryImageVersionName = "1.0.0"
156156
$location = "eastus"
157157
$sourceImageId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myVMRG/providers/Microsoft.Compute/virtualMachines/myVM"
158+
$diskEncryptionSetId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myVMRG/providers/Microsoft.Compute/diskEncryptionSets/cvmDiskEncryptionSet"
158159
$replicaCount = 1
159160
$storageAccountType = "Standard_ZRS"
160-
$region_eastus = @{Name = 'East US';ReplicaCount = 3;StorageAccountType = 'Standard_LRS'}
161+
$region_eastus = @{Name = 'East US';ReplicaCount = 3;StorageAccountType = 'Standard_LRS'; CVMEncryptionType="EncryptedWithCmk"; CVMDiskEncryptionSetID=$diskEncryptionSetId}
161162
$region_westus = @{Name = 'West US'}
162163
$region_ukwest = @{Name = 'UK West';ReplicaCount = 2}
163164
$region_southcentralus = @{Name = 'South Central US';StorageAccountType = 'Standard_LRS'}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"Module","Cmdlet","Example","Line","RuleName","ProblemId","Severity","Description","Extent","Remediation"
2+
"Compute","New-AzGalleryImageDefinition","4","11","MissingEndCurlyBrace","5200","1","Missing closing '}' in statement block or type definition.","","Unexpected Error. Please check [Trouble Shotting for Unexpected Errors in Example Issues](https://github.com/Azure/azure-powershell/blob/main/documentation/Debugging-StaticAnalysis-Errors.md#Troubleshotting-Example-Issues) for more details."
3+
"Compute","New-AzGalleryImageDefinition","4","11","UnexpectedToken","5200","1","Unexpected token '?????Name='SecurityType'' in expression or statement.","?????Name='SecurityType'","Unexpected Error. Please check [Trouble Shotting for Unexpected Errors in Example Issues](https://github.com/Azure/azure-powershell/blob/main/documentation/Debugging-StaticAnalysis-Errors.md#Troubleshotting-Example-Issues) for more details."
4+
"Compute","New-AzGalleryImageDefinition","4","14","UnexpectedToken","5200","1","Unexpected token '}' in expression or statement.","}","Unexpected Error. Please check [Trouble Shotting for Unexpected Errors in Example Issues](https://github.com/Azure/azure-powershell/blob/main/documentation/Debugging-StaticAnalysis-Errors.md#Troubleshotting-Example-Issues) for more details."
5+
"Compute","New-AzGalleryImageDefinition","4","11","Invalid_Cmdlet","5000","1","????? is not a valid command name.","?????","Check the spell of ?????."
6+
"Compute","New-AzGalleryImageDefinition","4","11","Invalid_Cmdlet","5000","1","?????Name='SecurityType' is not a valid command name.","?????Name='SecurityType'","Check the spell of ?????Name='SecurityType'."
7+
"Compute","New-AzGalleryImageDefinition","4","11","Invalid_Cmdlet","5000","1","Value='ConfidentialVMSupported' is not a valid command name.","Value='ConfidentialVMSupported'","Check the spell of Value='ConfidentialVMSupported'."
8+
"Compute","New-AzGalleryImageVersion","9","10","Invalid_Cmdlet","5000","1","EncryptedWithCmk is not a valid command name.","EncryptedWithCmk","Check the spell of EncryptedWithCmk."

0 commit comments

Comments
 (0)