From 70f84d535a71ec7caa66fc173323a8c159d9896c Mon Sep 17 00:00:00 2001 From: Theodore Chang Date: Tue, 21 Jun 2022 12:08:28 -0500 Subject: [PATCH 1/5] update sdk to latest --- src/Compute/Compute.Test/Compute.Test.csproj | 2 +- src/Compute/Compute/Compute.csproj | 2 +- src/Network/Network.Test/Network.Test.csproj | 2 +- .../RecoveryServices.Backup.Test.csproj | 2 +- .../RecoveryServices.SiteRecovery.Test.csproj | 2 +- src/Security/Security.Test/Security.Test.csproj | 2 +- .../SqlVirtualMachine.Test/SqlVirtualMachine.Test.csproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Compute/Compute.Test/Compute.Test.csproj b/src/Compute/Compute.Test/Compute.Test.csproj index 681347dedd4b..6e25de3c5387 100644 --- a/src/Compute/Compute.Test/Compute.Test.csproj +++ b/src/Compute/Compute.Test/Compute.Test.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Compute/Compute/Compute.csproj b/src/Compute/Compute/Compute.csproj index 19ec95f1cce6..893dc5670266 100644 --- a/src/Compute/Compute/Compute.csproj +++ b/src/Compute/Compute/Compute.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/Network/Network.Test/Network.Test.csproj b/src/Network/Network.Test/Network.Test.csproj index c020c31ddb81..4a06fc202f56 100644 --- a/src/Network/Network.Test/Network.Test.csproj +++ b/src/Network/Network.Test/Network.Test.csproj @@ -18,7 +18,7 @@ - + diff --git a/src/RecoveryServices/RecoveryServices.Backup.Test/RecoveryServices.Backup.Test.csproj b/src/RecoveryServices/RecoveryServices.Backup.Test/RecoveryServices.Backup.Test.csproj index f93a690c1a79..8c9a9b2e40fb 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Test/RecoveryServices.Backup.Test.csproj +++ b/src/RecoveryServices/RecoveryServices.Backup.Test/RecoveryServices.Backup.Test.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/RecoveryServices/RecoveryServices.SiteRecovery.Test/RecoveryServices.SiteRecovery.Test.csproj b/src/RecoveryServices/RecoveryServices.SiteRecovery.Test/RecoveryServices.SiteRecovery.Test.csproj index 5338e6668c83..4b7f1c2d6fc8 100644 --- a/src/RecoveryServices/RecoveryServices.SiteRecovery.Test/RecoveryServices.SiteRecovery.Test.csproj +++ b/src/RecoveryServices/RecoveryServices.SiteRecovery.Test/RecoveryServices.SiteRecovery.Test.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Security/Security.Test/Security.Test.csproj b/src/Security/Security.Test/Security.Test.csproj index b2d6d99795ef..e973d811d953 100644 --- a/src/Security/Security.Test/Security.Test.csproj +++ b/src/Security/Security.Test/Security.Test.csproj @@ -42,7 +42,7 @@ Always - + \ No newline at end of file diff --git a/src/SqlVirtualMachine/SqlVirtualMachine.Test/SqlVirtualMachine.Test.csproj b/src/SqlVirtualMachine/SqlVirtualMachine.Test/SqlVirtualMachine.Test.csproj index 85c2d00f063e..5c7e0a813bb4 100644 --- a/src/SqlVirtualMachine/SqlVirtualMachine.Test/SqlVirtualMachine.Test.csproj +++ b/src/SqlVirtualMachine/SqlVirtualMachine.Test/SqlVirtualMachine.Test.csproj @@ -15,7 +15,7 @@ - + From 54ff807ef180341760dc531d184290ed217d456f Mon Sep 17 00:00:00 2001 From: Theodore Chang Date: Tue, 21 Jun 2022 12:44:44 -0500 Subject: [PATCH 2/5] update add-azvm/vmss GalleryApplicationVersion --- ...ewAzureRmDiskEncryptionSetConfigCommand.cs | 56 ++++++++++++++++++- .../AddAzureVmGalleryApplicationCommand.cs | 11 ++++ .../AddAzureVmssGalleryApplicationCommand.cs | 11 ++++ .../Generated/Models/PSDiskEncryptionSet.cs | 1 + .../Models/PSVMGalleryApplication.cs | 2 + 5 files changed, 80 insertions(+), 1 deletion(-) diff --git a/src/Compute/Compute/Generated/DiskEncryptionSet/Config/NewAzureRmDiskEncryptionSetConfigCommand.cs b/src/Compute/Compute/Generated/DiskEncryptionSet/Config/NewAzureRmDiskEncryptionSetConfigCommand.cs index 40a2216b2891..3529377321b5 100644 --- a/src/Compute/Compute/Generated/DiskEncryptionSet/Config/NewAzureRmDiskEncryptionSetConfigCommand.cs +++ b/src/Compute/Compute/Generated/DiskEncryptionSet/Config/NewAzureRmDiskEncryptionSetConfigCommand.cs @@ -79,6 +79,17 @@ public partial class NewAzureRmDiskEncryptionSetConfigCommand : Microsoft.Azure. HelpMessage = "Gets or sets set this flag to true to enable auto-updating of this disk encryption")] public bool? RotationToLatestKeyVersionEnabled { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "Multi-tenant application client id to access key vault in a different tenant.")] + public string FederatedClientId { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The list of user identities associated with the disk encryption set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.")] + public Hashtable UserAssignedIdentity { get; set; } protected override void ProcessRecord() { @@ -127,6 +138,48 @@ private void Run() vActiveKey.KeyUrl = this.KeyUrl; } + if (this.IsParameterBound(c => c.UserAssignedIdentity)) + { + if (vIdentity == null) + { + vIdentity = new EncryptionSetIdentity(); + } + + /* + foreach (var identity in this.UserAssignedIdentity) + { + var target = new TargetRegion() + { + Name = (string)t["Name"], + RegionalReplicaCount = (int?)t["ReplicaCount"], + StorageAccountType = (string)t["StorageAccountType"], + }; + if (t["Encryption"] != null) + { + var osDiskEncryptionSetId = (string)((Hashtable)((Hashtable)t["Encryption"])["osDiskImage"])["DiskEncryptionSetId"]; + var osDiskImageEncryption = new OSDiskImageEncryption(osDiskEncryptionSetId); + + List dataDiskImageEncryption = null; + var dataDiskImage = (object[])((Hashtable)t["Encryption"])["dataDiskImages"]; + + if (dataDiskImage != null) + { + dataDiskImageEncryption = new List(); + foreach (Hashtable dataDiskEncryptionSetId in dataDiskImage) + { + DataDiskImageEncryption d = new DataDiskImageEncryption((int)dataDiskEncryptionSetId["Lun"], (string)dataDiskEncryptionSetId["DiskEncryptionSetId"]); + dataDiskImageEncryption.Add(d); + } + } + + target.Encryption = new EncryptionImages(osDiskImageEncryption, dataDiskImageEncryption); + } + + galleryImageVersion.PublishingProfile.TargetRegions.Add(target); + } + */ + } + var vDiskEncryptionSet = new PSDiskEncryptionSet { Location = this.IsParameterBound(c => c.Location) ? this.Location : null, @@ -134,7 +187,8 @@ private void Run() EncryptionType = this.IsParameterBound(c => c.EncryptionType) ? this.EncryptionType : null, Identity = vIdentity, ActiveKey = vActiveKey, - RotationToLatestKeyVersionEnabled = this.IsParameterBound(c => c.RotationToLatestKeyVersionEnabled) ? this.RotationToLatestKeyVersionEnabled : null + RotationToLatestKeyVersionEnabled = this.IsParameterBound(c => c.RotationToLatestKeyVersionEnabled) ? this.RotationToLatestKeyVersionEnabled : null, + FederatedClientId = this.IsParameterBound(c => c.FederatedClientId) ? this.FederatedClientId : null }; WriteObject(vDiskEncryptionSet); diff --git a/src/Compute/Compute/Generated/Gallery/AddAzureVmGalleryApplicationCommand.cs b/src/Compute/Compute/Generated/Gallery/AddAzureVmGalleryApplicationCommand.cs index a0d7fb6518d8..d56c6a8cec7d 100644 --- a/src/Compute/Compute/Generated/Gallery/AddAzureVmGalleryApplicationCommand.cs +++ b/src/Compute/Compute/Generated/Gallery/AddAzureVmGalleryApplicationCommand.cs @@ -41,6 +41,12 @@ public class AddAzureVmGalleryApplicationCommand : Microsoft.Azure.Commands.Reso Mandatory = false)] public int Order { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "If true, any failure for any operation in the VmApplication will fail the deployment. Defaults to false if not specified.")] + public SwitchParameter TreatFailureAsDeploymentFailure { get; set; } + public override void ExecuteCmdlet() { if (VM.ApplicationProfile == null) @@ -57,6 +63,11 @@ public override void ExecuteCmdlet() GalleryApplication.Order = this.Order; } + if (this.TreatFailureAsDeploymentFailure.IsPresent) + { + GalleryApplication.TreatFailureAsDeploymentFailure = true; + } + VM.ApplicationProfile.GalleryApplications.Add(GalleryApplication); WriteObject(VM); diff --git a/src/Compute/Compute/Generated/Gallery/AddAzureVmssGalleryApplicationCommand.cs b/src/Compute/Compute/Generated/Gallery/AddAzureVmssGalleryApplicationCommand.cs index d1d4b5bbe423..c931c09af882 100644 --- a/src/Compute/Compute/Generated/Gallery/AddAzureVmssGalleryApplicationCommand.cs +++ b/src/Compute/Compute/Generated/Gallery/AddAzureVmssGalleryApplicationCommand.cs @@ -36,6 +36,12 @@ public class AddAzureVmssGalleryApplicationCommand : Microsoft.Azure.Commands.Re HelpMessage = "VM Gallery Application Object.")] public PSVMGalleryApplication GalleryApplication { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "If true, any failure for any operation in the VmApplication will fail the deployment. Defaults to false if not specified.")] + public SwitchParameter TreatFailureAsDeploymentFailure { get; set; } + [Parameter( Mandatory = false)] public int Order { get; set; } @@ -56,6 +62,11 @@ public override void ExecuteCmdlet() GalleryApplication.Order = this.Order; } + if (this.TreatFailureAsDeploymentFailure.IsPresent) + { + GalleryApplication.TreatFailureAsDeploymentFailure = true; + } + VirtualMachineScaleSetVM.ApplicationProfile.GalleryApplications.Add(GalleryApplication); WriteObject(VirtualMachineScaleSetVM); diff --git a/src/Compute/Compute/Generated/Models/PSDiskEncryptionSet.cs b/src/Compute/Compute/Generated/Models/PSDiskEncryptionSet.cs index 4f1f2f4ab8d2..e7940a1c7d93 100644 --- a/src/Compute/Compute/Generated/Models/PSDiskEncryptionSet.cs +++ b/src/Compute/Compute/Generated/Models/PSDiskEncryptionSet.cs @@ -51,6 +51,7 @@ public string ResourceGroupName public IDictionary Tags { get; set; } public string EncryptionType { get; set; } public bool? RotationToLatestKeyVersionEnabled { get; set; } + public string FederatedClientId { get; set; } } } diff --git a/src/Compute/Compute/Generated/Models/PSVMGalleryApplication.cs b/src/Compute/Compute/Generated/Models/PSVMGalleryApplication.cs index 34f0643c8a7e..de11ddb61af2 100644 --- a/src/Compute/Compute/Generated/Models/PSVMGalleryApplication.cs +++ b/src/Compute/Compute/Generated/Models/PSVMGalleryApplication.cs @@ -32,6 +32,8 @@ public partial class PSVMGalleryApplication public int? Order { get; set; } public string PackageReferenceId { get; set; } public string ConfigurationReference { get; set; } + public bool? TreatFailureAsDeploymentFailure { get; set; } + public bool? EnableAutomaticUpgrade { get; set; } } } \ No newline at end of file From aa9094eb5b5fe399d01cdf97a256104c64446ae7 Mon Sep 17 00:00:00 2001 From: Theodore Chang Date: Wed, 22 Jun 2022 11:00:40 -0500 Subject: [PATCH 3/5] update --- .../DiskEncryptionSetUpdateMethod.cs | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/src/Compute/Compute/Generated/DiskEncryptionSet/DiskEncryptionSetUpdateMethod.cs b/src/Compute/Compute/Generated/DiskEncryptionSet/DiskEncryptionSetUpdateMethod.cs index 53a8fea26620..b6b39b0bb631 100644 --- a/src/Compute/Compute/Generated/DiskEncryptionSet/DiskEncryptionSetUpdateMethod.cs +++ b/src/Compute/Compute/Generated/DiskEncryptionSet/DiskEncryptionSetUpdateMethod.cs @@ -141,16 +141,29 @@ public override void ExecuteCmdlet() [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] public SwitchParameter AsJob { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "Multi-tenant application client id to access key vault in a different tenant. Setting value to 'None' will clear the property.")] + public string FederatedClientId { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The list of user identities associated with the disk encryption set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.")] + public Hashtable UserAssignedIdentity { get; set; } + private DiskEncryptionSetUpdate DiskEncryptionSetUpdate { get; set; } private void BuildPatchObject() { + if (this.DiskEncryptionSetUpdate == null) + { + this.DiskEncryptionSetUpdate = new DiskEncryptionSetUpdate(); + } + if (this.IsParameterBound(c => c.KeyUrl)) { - if (this.DiskEncryptionSetUpdate == null) - { - this.DiskEncryptionSetUpdate = new DiskEncryptionSetUpdate(); - } if (this.DiskEncryptionSetUpdate.ActiveKey == null) { //this.DiskEncryptionSetUpdate.ActiveKey = new KeyVaultAndKeyReference(); @@ -161,10 +174,6 @@ private void BuildPatchObject() if (this.IsParameterBound(c => c.SourceVaultId)) { - if (this.DiskEncryptionSetUpdate == null) - { - this.DiskEncryptionSetUpdate = new DiskEncryptionSetUpdate(); - } if (this.DiskEncryptionSetUpdate.ActiveKey == null) { //this.DiskEncryptionSetUpdate.ActiveKey = new KeyVaultAndKeyReference(); @@ -179,21 +188,18 @@ private void BuildPatchObject() if (this.IsParameterBound(c => c.Tag)) { - if (this.DiskEncryptionSetUpdate == null) - { - this.DiskEncryptionSetUpdate = new DiskEncryptionSetUpdate(); - } this.DiskEncryptionSetUpdate.Tags = this.Tag.Cast().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value); } if(this.IsParameterBound(c => c.RotationToLatestKeyVersionEnabled)) { - if (this.DiskEncryptionSetUpdate == null) - { - this.DiskEncryptionSetUpdate = new DiskEncryptionSetUpdate(); - } this.DiskEncryptionSetUpdate.RotationToLatestKeyVersionEnabled = this.RotationToLatestKeyVersionEnabled; } + + if(this.IsParameterBound(c => c.FederatedClientId)) + { + this.DiskEncryptionSetUpdate.FederatedClientId = this.FederatedClientId; + } } private void BuildPutObject() @@ -230,6 +236,10 @@ private void BuildPutObject() this.InputObject.RotationToLatestKeyVersionEnabled = this.RotationToLatestKeyVersionEnabled; } + if (this.IsParameterBound(c => c.FederatedClientId)) + { + this.InputObject.FederatedClientId = this.FederatedClientId; + } } } } From 39b0b6c267df82df2f212c87aa32424668858c87 Mon Sep 17 00:00:00 2001 From: Theodore Chang Date: Wed, 22 Jun 2022 18:01:48 -0500 Subject: [PATCH 4/5] update --- ...ewAzureRmDiskEncryptionSetConfigCommand.cs | 40 ++++--------- .../DiskEncryptionSetUpdateMethod.cs | 52 ++++++++++++++++ .../help/Add-AzVmGalleryApplication.md | 58 ++++++++++++++++-- .../help/Add-AzVmssGalleryApplication.md | 59 ++++++++++++++++--- .../help/New-AzDiskEncryptionSetConfig.md | 42 ++++++++++++- .../help/Update-AzDiskEncryptionSet.md | 43 ++++++++++++-- 6 files changed, 247 insertions(+), 47 deletions(-) diff --git a/src/Compute/Compute/Generated/DiskEncryptionSet/Config/NewAzureRmDiskEncryptionSetConfigCommand.cs b/src/Compute/Compute/Generated/DiskEncryptionSet/Config/NewAzureRmDiskEncryptionSetConfigCommand.cs index 3529377321b5..b4a859295bd5 100644 --- a/src/Compute/Compute/Generated/DiskEncryptionSet/Config/NewAzureRmDiskEncryptionSetConfigCommand.cs +++ b/src/Compute/Compute/Generated/DiskEncryptionSet/Config/NewAzureRmDiskEncryptionSetConfigCommand.cs @@ -144,40 +144,24 @@ private void Run() { vIdentity = new EncryptionSetIdentity(); } + if (vIdentity.UserAssignedIdentities == null) + { + vIdentity.UserAssignedIdentities = new Dictionary(); + } - /* - foreach (var identity in this.UserAssignedIdentity) + foreach (DictionaryEntry de in this.UserAssignedIdentity) { - var target = new TargetRegion() + if (((Hashtable)de.Value).Count == 0) { - Name = (string)t["Name"], - RegionalReplicaCount = (int?)t["ReplicaCount"], - StorageAccountType = (string)t["StorageAccountType"], - }; - if (t["Encryption"] != null) + vIdentity.UserAssignedIdentities.Add(de.Key.ToString(), new EncryptionSetIdentityUserAssignedIdentitiesValue()); + } + else { - var osDiskEncryptionSetId = (string)((Hashtable)((Hashtable)t["Encryption"])["osDiskImage"])["DiskEncryptionSetId"]; - var osDiskImageEncryption = new OSDiskImageEncryption(osDiskEncryptionSetId); - - List dataDiskImageEncryption = null; - var dataDiskImage = (object[])((Hashtable)t["Encryption"])["dataDiskImages"]; - - if (dataDiskImage != null) - { - dataDiskImageEncryption = new List(); - foreach (Hashtable dataDiskEncryptionSetId in dataDiskImage) - { - DataDiskImageEncryption d = new DataDiskImageEncryption((int)dataDiskEncryptionSetId["Lun"], (string)dataDiskEncryptionSetId["DiskEncryptionSetId"]); - dataDiskImageEncryption.Add(d); - } - } - - target.Encryption = new EncryptionImages(osDiskImageEncryption, dataDiskImageEncryption); + string principalId = ((Hashtable)de.Value)["principalId"]?.ToString(); + string clientId = ((Hashtable)de.Value)["clientId"]?.ToString(); + vIdentity.UserAssignedIdentities.Add(de.Key.ToString(), new EncryptionSetIdentityUserAssignedIdentitiesValue(principalId, clientId)); } - - galleryImageVersion.PublishingProfile.TargetRegions.Add(target); } - */ } var vDiskEncryptionSet = new PSDiskEncryptionSet diff --git a/src/Compute/Compute/Generated/DiskEncryptionSet/DiskEncryptionSetUpdateMethod.cs b/src/Compute/Compute/Generated/DiskEncryptionSet/DiskEncryptionSetUpdateMethod.cs index b6b39b0bb631..2ea4c589e058 100644 --- a/src/Compute/Compute/Generated/DiskEncryptionSet/DiskEncryptionSetUpdateMethod.cs +++ b/src/Compute/Compute/Generated/DiskEncryptionSet/DiskEncryptionSetUpdateMethod.cs @@ -200,6 +200,32 @@ private void BuildPatchObject() { this.DiskEncryptionSetUpdate.FederatedClientId = this.FederatedClientId; } + + if (this.IsParameterBound(c => c.UserAssignedIdentity)) + { + if (this.DiskEncryptionSetUpdate.Identity == null) + { + this.DiskEncryptionSetUpdate.Identity = new EncryptionSetIdentity(); + } + if (this.DiskEncryptionSetUpdate.Identity.UserAssignedIdentities == null) + { + this.DiskEncryptionSetUpdate.Identity.UserAssignedIdentities = new Dictionary(); + } + + foreach (DictionaryEntry de in this.UserAssignedIdentity) + { + if (((Hashtable)de.Value).Count == 0) + { + this.DiskEncryptionSetUpdate.Identity.UserAssignedIdentities.Add(de.Key.ToString(), new EncryptionSetIdentityUserAssignedIdentitiesValue()); + } + else + { + string principalId = ((Hashtable)de.Value)["principalId"]?.ToString(); + string clientId = ((Hashtable)de.Value)["clientId"]?.ToString(); + this.DiskEncryptionSetUpdate.Identity.UserAssignedIdentities.Add(de.Key.ToString(), new EncryptionSetIdentityUserAssignedIdentitiesValue(principalId, clientId)); + } + } + } } private void BuildPutObject() @@ -240,6 +266,32 @@ private void BuildPutObject() { this.InputObject.FederatedClientId = this.FederatedClientId; } + + if (this.IsParameterBound(c => c.UserAssignedIdentity)) + { + if (this.InputObject.Identity == null) + { + this.InputObject.Identity = new EncryptionSetIdentity(); + } + if (this.InputObject.Identity.UserAssignedIdentities == null) + { + this.InputObject.Identity.UserAssignedIdentities = new Dictionary(); + } + + foreach (DictionaryEntry de in this.UserAssignedIdentity) + { + if (((Hashtable)de.Value).Count == 0) + { + this.InputObject.Identity.UserAssignedIdentities.Add(de.Key.ToString(), new EncryptionSetIdentityUserAssignedIdentitiesValue()); + } + else + { + string principalId = ((Hashtable)de.Value)["principalId"]?.ToString(); + string clientId = ((Hashtable)de.Value)["clientId"]?.ToString(); + this.InputObject.Identity.UserAssignedIdentities.Add(de.Key.ToString(), new EncryptionSetIdentityUserAssignedIdentitiesValue(principalId, clientId)); + } + } + } } } } diff --git a/src/Compute/Compute/help/Add-AzVmGalleryApplication.md b/src/Compute/Compute/help/Add-AzVmGalleryApplication.md index ccffc85e58fa..a59299eec98c 100644 --- a/src/Compute/Compute/help/Add-AzVmGalleryApplication.md +++ b/src/Compute/Compute/help/Add-AzVmGalleryApplication.md @@ -1,7 +1,7 @@ --- external help file: Microsoft.Azure.PowerShell.Cmdlets.Compute.dll-Help.xml Module Name: Az.Compute -online version:https://docs.microsoft.com/powershell/module/az.compute/add-azvmgalleryapplication +online version: https://docs.microsoft.com/powershell/module/az.compute/add-azvmgalleryapplication schema: 2.0.0 --- @@ -14,7 +14,8 @@ Add a GalleryApplication object to the PSVirtualMachine object. ``` Add-AzVmGalleryApplication -VM -GalleryApplication [-Order ] - [-DefaultProfile ] [] + [-TreatFailureAsDeploymentFailure] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -37,7 +38,7 @@ This example creates a local VMGalleryApplication object and adds it to a PSVirt The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: IAzureContextContainer Parameter Sets: (All) Aliases: AzContext, AzureRmContext, AzureCredential @@ -52,7 +53,7 @@ Accept wildcard characters: False PSVMGalleryApplication Object. ```yaml -Type: Microsoft.Azure.Commands.Compute.Automation.Models.PSVMGalleryApplication +Type: PSVMGalleryApplication Parameter Sets: (All) Aliases: @@ -67,7 +68,7 @@ Accept wildcard characters: False Order in which the application will be install in. ```yaml -Type: System.Int32 +Type: Int32 Parameter Sets: (All) Aliases: @@ -78,11 +79,26 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -TreatFailureAsDeploymentFailure +If true, any failure for any operation in the VmApplication will fail the deployment. Defaults to false if not specified. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -VM The PSVirtualMachine object to add a Gallery Application Reference ID. ```yaml -Type: Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine +Type: PSVirtualMachine Parameter Sets: (All) Aliases: @@ -93,6 +109,36 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/src/Compute/Compute/help/Add-AzVmssGalleryApplication.md b/src/Compute/Compute/help/Add-AzVmssGalleryApplication.md index 8727a2778cb4..350655ead47f 100644 --- a/src/Compute/Compute/help/Add-AzVmssGalleryApplication.md +++ b/src/Compute/Compute/help/Add-AzVmssGalleryApplication.md @@ -1,7 +1,7 @@ --- external help file: Microsoft.Azure.PowerShell.Cmdlets.Compute.dll-Help.xml Module Name: Az.Compute -online version:https://docs.microsoft.com/powershell/module/az.compute/add-azvmssgalleryapplication +online version: https://docs.microsoft.com/powershell/module/az.compute/add-azvmssgalleryapplication schema: 2.0.0 --- @@ -14,8 +14,8 @@ Add a GalleryApplication object to the PSVirtualMachineProfile object. ``` Add-AzVmssGalleryApplication -VirtualMachineScaleSetVM - -GalleryApplication [-Order ] [-DefaultProfile ] - [] + -GalleryApplication [-TreatFailureAsDeploymentFailure] [-Order ] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -38,7 +38,7 @@ This example creates a local VMGalleryApplication object and adds it to a PSVirt The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: IAzureContextContainer Parameter Sets: (All) Aliases: AzContext, AzureRmContext, AzureCredential @@ -53,7 +53,7 @@ Accept wildcard characters: False VM Gallery Application Object. ```yaml -Type: Microsoft.Azure.Commands.Compute.Automation.Models.PSVMGalleryApplication +Type: PSVMGalleryApplication Parameter Sets: (All) Aliases: @@ -68,7 +68,7 @@ Accept wildcard characters: False Order in which the application will be install in. ```yaml -Type: System.Int32 +Type: Int32 Parameter Sets: (All) Aliases: @@ -79,11 +79,26 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -TreatFailureAsDeploymentFailure +If true, any failure for any operation in the VmApplication will fail the deployment. Defaults to false if not specified. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -VirtualMachineScaleSetVM The PSVirtualMachineScaleSetVMProfile object to add a Gallery Application Reference ID. ```yaml -Type: Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineScaleSetVMProfile +Type: PSVirtualMachineScaleSetVMProfile Parameter Sets: (All) Aliases: @@ -94,6 +109,36 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/src/Compute/Compute/help/New-AzDiskEncryptionSetConfig.md b/src/Compute/Compute/help/New-AzDiskEncryptionSetConfig.md index 92cfa87e5b67..0a0bdb8a2999 100644 --- a/src/Compute/Compute/help/New-AzDiskEncryptionSetConfig.md +++ b/src/Compute/Compute/help/New-AzDiskEncryptionSetConfig.md @@ -15,7 +15,8 @@ Creates a configurable disk encryption set object. ``` New-AzDiskEncryptionSetConfig [-Location] [[-Tag] ] [[-IdentityType] ] [[-SourceVaultId] ] [-KeyUrl ] [-EncryptionType ] - [-RotationToLatestKeyVersionEnabled ] [-DefaultProfile ] [-WhatIf] [-Confirm] + [-RotationToLatestKeyVersionEnabled ] [-FederatedClientId ] + [-UserAssignedIdentity ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -32,6 +33,15 @@ $config | New-AzDiskEncryptionSet -ResourceGroupName 'rg1' -Name 'enc1' Creates disk encryption set using the given active key in the key vault. +### Example 1 +```powershell +$userAssignedIdentities = @{ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}" = @{}}; +$config = New-AzDiskEncryptionSetConfig -Location 'westcentralus' -KeyUrl "https://valut1.vault.azure.net:443/keys/key1/mykey" -SourceVaultId '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.KeyVault/vaults/vault1' -IdentityType 'UserAssigned' -RotationToLatestKeyVersionEnabled $True -UserAssignedIdentity $userAssignedIdentities -FederatedClientId “13ebe945-1314-41b4-8b58-f3784e0dd278” +$config | New-AzDiskEncryptionSet -ResourceGroupName 'rg1' -Name 'enc1' +``` + +Using UserAssignedIdentity and FederatedClientId + ## PARAMETERS ### -DefaultProfile @@ -64,6 +74,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -FederatedClientId +Multi-tenant application client id to access key vault in a different tenant. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -IdentityType The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported. @@ -155,6 +180,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -UserAssignedIdentity +The list of user identities associated with the disk encryption set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. diff --git a/src/Compute/Compute/help/Update-AzDiskEncryptionSet.md b/src/Compute/Compute/help/Update-AzDiskEncryptionSet.md index c7fb2a199675..3e778b70599f 100644 --- a/src/Compute/Compute/help/Update-AzDiskEncryptionSet.md +++ b/src/Compute/Compute/help/Update-AzDiskEncryptionSet.md @@ -16,21 +16,24 @@ Updates a disk encryption set. ``` Update-AzDiskEncryptionSet [-ResourceGroupName] [-Name] [-KeyUrl ] [-SourceVaultId ] [-RotationToLatestKeyVersionEnabled ] [[-Tag] ] [-AsJob] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-FederatedClientId ] [-UserAssignedIdentity ] [-DefaultProfile ] + [-WhatIf] [-Confirm] [] ``` ### ResourceIdParameter ``` Update-AzDiskEncryptionSet [-ResourceId] [-KeyUrl ] [-SourceVaultId ] - [-RotationToLatestKeyVersionEnabled ] [[-Tag] ] [-AsJob] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-RotationToLatestKeyVersionEnabled ] [[-Tag] ] [-AsJob] [-FederatedClientId ] + [-UserAssignedIdentity ] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ObjectParameter ``` Update-AzDiskEncryptionSet [-InputObject] [-KeyUrl ] [-SourceVaultId ] - [-RotationToLatestKeyVersionEnabled ] [[-Tag] ] [-AsJob] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-RotationToLatestKeyVersionEnabled ] [[-Tag] ] [-AsJob] [-FederatedClientId ] + [-UserAssignedIdentity ] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -77,6 +80,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -FederatedClientId +Multi-tenant application client id to access key vault in a different tenant. Setting value to 'None' will clear the property. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -InputObject The local object of the disk encryption set. @@ -198,6 +216,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -UserAssignedIdentity +The list of user identities associated with the disk encryption set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. From e3d350db1db229a229962dd8c0fe05d42960e2b8 Mon Sep 17 00:00:00 2001 From: Theodore Chang Date: Wed, 22 Jun 2022 18:03:57 -0500 Subject: [PATCH 5/5] changelog --- src/Compute/Compute/ChangeLog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index 9e3ad3462d20..3f49fefca980 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -24,6 +24,10 @@ * An unresolved path can be passed in for '-LocalFilePath' for `Add-AzVhd`. The cmdlet with unresolve the path itself. * Added `-DataAccessAuthMode` parameter to Add-AzVhd DirectUploadToManagedDisk parameter set. * Added `-EnabldUltraSSD` parameter to New-AzHostGroup. +* Added `-UserAssignedIdentity` and `-FederatedClientId` to the following cmdlets: + - `New-AzDiskEncryptionSetConfig` + - `Update-AzDiskEncryptionSet` +* Added `-TreatFailureAsDeploymentFailure` to cmdlets `Add-AzVmGalleryApplication` and `Add-AzVmssGalleryApplication` ## Version 4.27.0 * Edited `New-AzVm` cmdlet internal logic to use the `PlatformFaultDomain` value in the `PSVirtualMachine` object passed to it in the new virtual machine.