From 54291b6dd1dac4176c562f3618326b7e5c6a2956 Mon Sep 17 00:00:00 2001 From: Theodore Chang Date: Wed, 11 May 2022 21:43:06 +0100 Subject: [PATCH 1/5] updates to cmdlets --- .../Config/NewAzureRmDiskConfigCommand.cs | 16 ++++++++++++++ .../NewAzureRmDiskUpdateConfigCommand.cs | 16 ++++++++++++++ .../GalleryImageCreateOrUpdateMethod.cs | 12 +++++++++++ .../Generated/Models/PSGalleryImage.cs | 1 + .../Generated/Models/PSSnapshotUpdate.cs | 1 + .../Config/NewAzureRmSnapshotConfigCommand.cs | 16 ++++++++++++++ .../NewAzureRmSnapshotUpdateConfigCommand.cs | 21 ++++++++++++++++++- .../Compute/Models/PSVirtualMachineImage.cs | 2 ++ 8 files changed, 84 insertions(+), 1 deletion(-) diff --git a/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskConfigCommand.cs b/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskConfigCommand.cs index 775953754fd2..bbd4168cb81f 100644 --- a/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskConfigCommand.cs +++ b/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskConfigCommand.cs @@ -228,6 +228,13 @@ public partial class NewAzureRmDiskConfigCommand : Microsoft.Azure.Commands.Reso HelpMessage = "True if the image from which the OS disk is created supports accelerated networking.")] public bool? AcceleratedNetwork { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "CPU architecture supported by an OS disk. Possible values are \"X64\" and \"Arm64\".")] + [PSArgumentCompleter("X64", "Arm64")] + public string Architecture { get; set; } + protected override void ProcessRecord() { if (ShouldProcess("Disk", "New")) @@ -418,6 +425,15 @@ private void Run() vSupportedCapabilities.AcceleratedNetwork = AcceleratedNetwork; } + if (this.IsParameterBound(c => c.Architecture)) + { + if (vSupportedCapabilities == null) + { + vSupportedCapabilities = new SupportedCapabilities(); + } + vSupportedCapabilities.Architecture = this.Architecture; + } + var vDisk = new PSDisk { Zones = this.IsParameterBound(c => c.Zone) ? this.Zone : null, diff --git a/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskUpdateConfigCommand.cs b/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskUpdateConfigCommand.cs index 9339cc8b7805..7764bebafe73 100644 --- a/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskUpdateConfigCommand.cs +++ b/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskUpdateConfigCommand.cs @@ -161,6 +161,13 @@ public partial class NewAzureRmDiskUpdateConfigCommand : Microsoft.Azure.Command HelpMessage = "True if the image from which the OS disk is created supports accelerated networking.")] public bool? AcceleratedNetwork { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "CPU architecture supported by an OS disk. Possible values are \"X64\" and \"Arm64\".")] + [PSArgumentCompleter("X64", "Arm64")] + public string Architecture { get; set; } + protected override void ProcessRecord() { @@ -274,6 +281,15 @@ private void Run() vSupportedCapabilities.AcceleratedNetwork = AcceleratedNetwork; } + if (this.IsParameterBound(c => c.Architecture)) + { + if (vSupportedCapabilities == null) + { + vSupportedCapabilities = new SupportedCapabilities(); + } + vSupportedCapabilities.Architecture = this.Architecture; + } + var vDiskUpdate = new PSDiskUpdate { OsType = this.IsParameterBound(c => c.OsType) ? this.OsType : (OperatingSystemTypes?)null, diff --git a/src/Compute/Compute/Generated/GalleryImage/GalleryImageCreateOrUpdateMethod.cs b/src/Compute/Compute/Generated/GalleryImage/GalleryImageCreateOrUpdateMethod.cs index 0160ba86226e..bf1cf8a0fedd 100644 --- a/src/Compute/Compute/Generated/GalleryImage/GalleryImageCreateOrUpdateMethod.cs +++ b/src/Compute/Compute/Generated/GalleryImage/GalleryImageCreateOrUpdateMethod.cs @@ -403,6 +403,11 @@ public override void ExecuteCmdlet() galleryImage.Tags = this.Tag.Cast().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value); } + if (this.IsParameterBound(c => c.Architecture)) + { + galleryImage.Architecture = this.Architecture; + } + if (this.IsParameterBound(c => c.MinimumVCPU)) { if (galleryImage.Recommended == null) @@ -605,6 +610,13 @@ public override void ExecuteCmdlet() ValueFromPipelineByPropertyName = true)] public string ReleaseNoteUri { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "CPU architecture supported by an OS disk. Possible values are \"X64\" and \"Arm64\".")] + [PSArgumentCompleter("X64", "Arm64")] + public string Architecture { get; set; } + [Parameter( Mandatory = false, ValueFromPipelineByPropertyName = true)] diff --git a/src/Compute/Compute/Generated/Models/PSGalleryImage.cs b/src/Compute/Compute/Generated/Models/PSGalleryImage.cs index e3a9f8a7b744..018b4df25dd4 100644 --- a/src/Compute/Compute/Generated/Models/PSGalleryImage.cs +++ b/src/Compute/Compute/Generated/Models/PSGalleryImage.cs @@ -59,6 +59,7 @@ public string ResourceGroupName public string Location { get; set; } public IDictionary Tags { get; set; } public IList Features { get; set; } + public string Architecture { get; set; } } } diff --git a/src/Compute/Compute/Generated/Models/PSSnapshotUpdate.cs b/src/Compute/Compute/Generated/Models/PSSnapshotUpdate.cs index 517bd8ab0157..68c7327cff02 100644 --- a/src/Compute/Compute/Generated/Models/PSSnapshotUpdate.cs +++ b/src/Compute/Compute/Generated/Models/PSSnapshotUpdate.cs @@ -34,6 +34,7 @@ public partial class PSSnapshotUpdate public IDictionary Tags { get; set; } public SnapshotSku Sku { get; set; } public bool? SupportsHibernation { get; set; } + public SupportedCapabilities SupportedCapabilities { get; set; } // // Summary: diff --git a/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotConfigCommand.cs b/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotConfigCommand.cs index 7e1efda74034..ffb38ca25e08 100644 --- a/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotConfigCommand.cs +++ b/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotConfigCommand.cs @@ -173,6 +173,13 @@ public partial class NewAzureRmSnapshotConfigCommand : Microsoft.Azure.Commands. HelpMessage = "True if the image from which the OS disk is created supports accelerated networking.")] public bool? AcceleratedNetwork { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "CPU architecture supported by an OS disk. Possible values are \"X64\" and \"Arm64\".")] + [PSArgumentCompleter("X64", "Arm64")] + public string Architecture { get; set; } + protected override void ProcessRecord() { if (ShouldProcess("Snapshot", "New")) @@ -336,6 +343,15 @@ private void Run() vSupportedCapabilities.AcceleratedNetwork = AcceleratedNetwork; } + if (this.IsParameterBound(c => c.Architecture)) + { + if (vSupportedCapabilities == null) + { + vSupportedCapabilities = new SupportedCapabilities(); + } + vSupportedCapabilities.Architecture = this.Architecture; + } + var vSnapshot = new PSSnapshot { OsType = this.IsParameterBound(c => c.OsType) ? this.OsType : (OperatingSystemTypes?)null, diff --git a/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotUpdateConfigCommand.cs b/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotUpdateConfigCommand.cs index 7275d2602a14..1c9c1aa2cd80 100644 --- a/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotUpdateConfigCommand.cs +++ b/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotUpdateConfigCommand.cs @@ -101,6 +101,13 @@ public partial class NewAzureRmSnapshotUpdateConfigCommand : Microsoft.Azure.Com [PSArgumentCompleter("Enabled", "Disabled")] public string PublicNetworkAccess { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "CPU architecture supported by an OS disk. Possible values are \"X64\" and \"Arm64\".")] + [PSArgumentCompleter("X64", "Arm64")] + public string Architecture { get; set; } + protected override void ProcessRecord() { if (ShouldProcess("SnapshotUpdate", "New")) @@ -120,6 +127,8 @@ private void Run() // Sku SnapshotSku vSku = null; + SupportedCapabilities vSupportedCapabilities = null; + if (this.IsParameterBound(c => c.EncryptionSettingsEnabled)) { if (vEncryptionSettingsCollection == null) @@ -193,6 +202,15 @@ private void Run() vSku.Name = this.SkuName; } + if (this.IsParameterBound(c => c.Architecture)) + { + if (vSupportedCapabilities == null) + { + vSupportedCapabilities = new SupportedCapabilities(); + } + vSupportedCapabilities.Architecture = this.Architecture; + } + var vSnapshotUpdate = new PSSnapshotUpdate { OsType = this.IsParameterBound(c => c.OsType) ? this.OsType : (OperatingSystemTypes?)null, @@ -202,7 +220,8 @@ private void Run() Encryption = vEncryption, Sku = vSku, SupportsHibernation = this.IsParameterBound(c => c.SupportsHibernation) ? SupportsHibernation : null, - PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null + PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null, + SupportedCapabilities = vSupportedCapabilities }; WriteObject(vSnapshotUpdate); diff --git a/src/Compute/Compute/Models/PSVirtualMachineImage.cs b/src/Compute/Compute/Models/PSVirtualMachineImage.cs index ed2fee8e2b60..f7bc1a3c33d4 100644 --- a/src/Compute/Compute/Models/PSVirtualMachineImage.cs +++ b/src/Compute/Compute/Models/PSVirtualMachineImage.cs @@ -81,5 +81,7 @@ public string DataDiskImagesText } public AutomaticOSUpgradeProperties AutomaticOSUpgradeProperties { get; set; } + + public string Architecture { get; set; } } } From bb5b5513be58f140e0a65db968fe5dd596acf679 Mon Sep 17 00:00:00 2001 From: Theodore Chang Date: Wed, 11 May 2022 21:58:29 +0100 Subject: [PATCH 2/5] fix NewGalleryImage instead of update, add md files, update changelog --- src/Compute/Compute/ChangeLog.md | 6 +++++ .../GalleryImageCreateOrUpdateMethod.cs | 24 +++++++++---------- src/Compute/Compute/help/New-AzDiskConfig.md | 19 +++++++++++++-- .../Compute/help/New-AzDiskUpdateConfig.md | 17 ++++++++++++- .../Compute/help/New-AzSnapshotConfig.md | 17 ++++++++++++- .../help/New-AzSnapshotUpdateConfig.md | 17 ++++++++++++- 6 files changed, 83 insertions(+), 17 deletions(-) diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index 9e7a0994a067..f17ce8b09e2f 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -21,6 +21,12 @@ --> ## Upcoming Release * Edited `New-AzVm` cmdlet internal logic to use the `PlatformFaultDomain` value in the `PSVirtualMachine` object passed to it in the new virtual machine. +* Added `-Architecture` parameter to the following cmdlets: + - New-AzDiskConfig`` + - New-AzDiskUpdateConfig + - New-AzSnapshotConfig + - New-AzSnapshotUpdateConfig + - New-AzGalleryImageDefinition ## Version 4.26.0 * Added `-ImageReferenceId` parameter to following cmdlets: `New-AzVm`, `New-AzVmConfig`, `New-AzVmss`, `Set-AzVmssStorageProfile` diff --git a/src/Compute/Compute/Generated/GalleryImage/GalleryImageCreateOrUpdateMethod.cs b/src/Compute/Compute/Generated/GalleryImage/GalleryImageCreateOrUpdateMethod.cs index bf1cf8a0fedd..99d419e0775d 100644 --- a/src/Compute/Compute/Generated/GalleryImage/GalleryImageCreateOrUpdateMethod.cs +++ b/src/Compute/Compute/Generated/GalleryImage/GalleryImageCreateOrUpdateMethod.cs @@ -83,6 +83,11 @@ public override void ExecuteCmdlet() galleryImage.EndOfLifeDate = this.EndOfLifeDate; } + if (this.IsParameterBound(c => c.Architecture)) + { + galleryImage.Architecture = this.Architecture; + } + if (this.IsParameterBound(c => c.Tag)) { galleryImage.Tags = this.Tag.Cast().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value); @@ -327,6 +332,13 @@ public override void ExecuteCmdlet() Mandatory = false, ValueFromPipelineByPropertyName = true)] public GalleryImageFeature[] Feature { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "CPU architecture supported by an OS disk. Possible values are \"X64\" and \"Arm64\".")] + [PSArgumentCompleter("X64", "Arm64")] + public string Architecture { get; set; } } [Cmdlet(VerbsData.Update, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "GalleryImageDefinition", DefaultParameterSetName = "DefaultParameter", SupportsShouldProcess = true)] @@ -403,11 +415,6 @@ public override void ExecuteCmdlet() galleryImage.Tags = this.Tag.Cast().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value); } - if (this.IsParameterBound(c => c.Architecture)) - { - galleryImage.Architecture = this.Architecture; - } - if (this.IsParameterBound(c => c.MinimumVCPU)) { if (galleryImage.Recommended == null) @@ -610,13 +617,6 @@ public override void ExecuteCmdlet() ValueFromPipelineByPropertyName = true)] public string ReleaseNoteUri { get; set; } - [Parameter( - Mandatory = false, - ValueFromPipelineByPropertyName = true, - HelpMessage = "CPU architecture supported by an OS disk. Possible values are \"X64\" and \"Arm64\".")] - [PSArgumentCompleter("X64", "Arm64")] - public string Architecture { get; set; } - [Parameter( Mandatory = false, ValueFromPipelineByPropertyName = true)] diff --git a/src/Compute/Compute/help/New-AzDiskConfig.md b/src/Compute/Compute/help/New-AzDiskConfig.md index de47c57e25fa..6a846124fef7 100644 --- a/src/Compute/Compute/help/New-AzDiskConfig.md +++ b/src/Compute/Compute/help/New-AzDiskConfig.md @@ -24,8 +24,8 @@ New-AzDiskConfig [[-SkuName] ] [-Tier ] [-LogicalSectorSize ] [-KeyEncryptionKey ] [-DiskEncryptionSetId ] [-EncryptionType ] [-DiskAccessId ] [-NetworkAccessPolicy ] [-BurstingEnabled ] [-PublicNetworkAccess ] - [-AcceleratedNetwork ] [-DefaultProfile ] [-WhatIf] [-Confirm] - [] + [-AcceleratedNetwork ] [-Architecture ] [-DefaultProfile ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -97,6 +97,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -Architecture +CPU architecture supported by an OS disk. Possible values are "X64" and "Arm64". + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -BurstingEnabled Enables bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. diff --git a/src/Compute/Compute/help/New-AzDiskUpdateConfig.md b/src/Compute/Compute/help/New-AzDiskUpdateConfig.md index 6031a2b6419b..280e3d9a052a 100644 --- a/src/Compute/Compute/help/New-AzDiskUpdateConfig.md +++ b/src/Compute/Compute/help/New-AzDiskUpdateConfig.md @@ -20,7 +20,7 @@ New-AzDiskUpdateConfig [[-SkuName] ] [-Tier ] [-DiskIOPSReadOnly [-EncryptionSettingsEnabled ] [-DiskEncryptionKey ] [-KeyEncryptionKey ] [-DiskEncryptionSetId ] [-EncryptionType ] [-BurstingEnabled ] [-PublicNetworkAccess ] [-AcceleratedNetwork ] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-Architecture ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -70,6 +70,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -Architecture +CPU architecture supported by an OS disk. Possible values are "X64" and "Arm64". + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -BurstingEnabled Enables bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. diff --git a/src/Compute/Compute/help/New-AzSnapshotConfig.md b/src/Compute/Compute/help/New-AzSnapshotConfig.md index 1d7e11e904d4..dd8dcac7e817 100644 --- a/src/Compute/Compute/help/New-AzSnapshotConfig.md +++ b/src/Compute/Compute/help/New-AzSnapshotConfig.md @@ -21,7 +21,7 @@ New-AzSnapshotConfig [[-SkuName] ] [[-OsType] ] [[ [-DiskEncryptionKey ] [-KeyEncryptionKey ] [-DiskEncryptionSetId ] [-EncryptionType ] [-DiskAccessId ] [-NetworkAccessPolicy ] [-PublicNetworkAccess ] [-AcceleratedNetwork ] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-Architecture ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -71,6 +71,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -Architecture +CPU architecture supported by an OS disk. Possible values are "X64" and "Arm64". + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -CreateOption Specifies whether this cmdlet creates a disk in the virtual machine from a platform or user image, creates an empty disk, or attaches an existing disk. diff --git a/src/Compute/Compute/help/New-AzSnapshotUpdateConfig.md b/src/Compute/Compute/help/New-AzSnapshotUpdateConfig.md index 51ca31d63ee7..ee4741603b39 100644 --- a/src/Compute/Compute/help/New-AzSnapshotUpdateConfig.md +++ b/src/Compute/Compute/help/New-AzSnapshotUpdateConfig.md @@ -17,7 +17,7 @@ New-AzSnapshotUpdateConfig [[-SkuName] ] [[-OsType] ] [-SupportsHibernation ] [-EncryptionSettingsEnabled ] [-DiskEncryptionKey ] [-KeyEncryptionKey ] [-DiskEncryptionSetId ] [-EncryptionType ] [-PublicNetworkAccess ] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-Architecture ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -53,6 +53,21 @@ This command updates an existing snapshot with name 'Snapshot01' in resource gro ## PARAMETERS +### -Architecture +CPU architecture supported by an OS disk. Possible values are "X64" and "Arm64". + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with azure. From aef512138b5ac7facb0b569823fc966c57c2f140 Mon Sep 17 00:00:00 2001 From: Theodore Chang Date: Wed, 11 May 2022 22:06:20 +0100 Subject: [PATCH 3/5] update last md --- .../help/New-AzGalleryImageDefinition.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/Compute/Compute/help/New-AzGalleryImageDefinition.md b/src/Compute/Compute/help/New-AzGalleryImageDefinition.md index 8f82c2914729..99dfd0b392ef 100644 --- a/src/Compute/Compute/help/New-AzGalleryImageDefinition.md +++ b/src/Compute/Compute/help/New-AzGalleryImageDefinition.md @@ -20,7 +20,7 @@ New-AzGalleryImageDefinition [-ResourceGroupName] [-GalleryName] ] [-Eula ] [-HyperVGeneration ] [-MinimumMemory ] [-MinimumVCPU ] [-MaximumMemory ] [-MaximumVCPU ] [-PrivacyStatementUri ] [-PurchasePlanName ] [-PurchasePlanProduct ] [-PurchasePlanPublisher ] - [-ReleaseNoteUri ] [-Tag ] [-Feature ] + [-ReleaseNoteUri ] [-Tag ] [-Feature ] [-Architecture ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -78,7 +78,7 @@ New-AzGalleryImageDefinition -ResourceGroupName $rgName -GalleryName $galleryNam Creates a gallery image definition to contain image versions for specialized windows images. -### Example 4: Create an image definition for generalized windows images and set features. +### Example 4: Create an image definition for generalized windows images and set features. ```powershell $rgName = "myResourceGroup" @@ -186,6 +186,21 @@ Creates a gallery image definition for linux generalized images and specify eith ## PARAMETERS +### -Architecture +CPU architecture supported by an OS disk. Possible values are "X64" and "Arm64". + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -AsJob Run cmdlet in the background From 58d19de0e2f539885d4ee7cee1a1ea0604716bb0 Mon Sep 17 00:00:00 2001 From: Theodore Chang Date: Thu, 12 May 2022 16:18:24 +0100 Subject: [PATCH 4/5] Feature/cplat data auth access (#18137) * add -DataAccessAuthMode to Snaptshot/Disk config/updateConfig * trying DataAuth in Add-AzVhd * progress save for Add-AzVhd * remove add-azvhd stuff * md files --- src/Compute/Compute/ChangeLog.md | 5 +++++ .../Config/NewAzureRmDiskConfigCommand.cs | 10 +++++++++- .../NewAzureRmDiskUpdateConfigCommand.cs | 10 +++++++++- .../Compute/Generated/Models/PSDisk.cs | 11 +---------- .../Compute/Generated/Models/PSDiskUpdate.cs | 1 + .../Compute/Generated/Models/PSSnapshot.cs | 2 +- .../Generated/Models/PSSnapshotUpdate.cs | 1 + .../Config/NewAzureRmSnapshotConfigCommand.cs | 10 +++++++++- .../NewAzureRmSnapshotUpdateConfigCommand.cs | 8 ++++++++ .../StorageServices/AddAzureVhdCommand.cs | 6 +++--- src/Compute/Compute/help/New-AzDiskConfig.md | 19 +++++++++++++++++-- .../Compute/help/New-AzDiskUpdateConfig.md | 18 +++++++++++++++++- .../Compute/help/New-AzSnapshotConfig.md | 18 +++++++++++++++++- .../help/New-AzSnapshotUpdateConfig.md | 18 +++++++++++++++++- 14 files changed, 115 insertions(+), 22 deletions(-) diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index f17ce8b09e2f..b9ac7bba315c 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -21,6 +21,11 @@ --> ## Upcoming Release * Edited `New-AzVm` cmdlet internal logic to use the `PlatformFaultDomain` value in the `PSVirtualMachine` object passed to it in the new virtual machine. +* Add `-DataAccessAuthMode` parameter to the following cmdlets: + - New-AzDiskConfig + - New-AzDiskUpdateConfig + - New-AzSnapshotConfig + - New-AzSnapshotUpdateConfig * Added `-Architecture` parameter to the following cmdlets: - New-AzDiskConfig`` - New-AzDiskUpdateConfig diff --git a/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskConfigCommand.cs b/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskConfigCommand.cs index bbd4168cb81f..a340a1c8f7b4 100644 --- a/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskConfigCommand.cs +++ b/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskConfigCommand.cs @@ -228,6 +228,13 @@ public partial class NewAzureRmDiskConfigCommand : Microsoft.Azure.Commands.Reso HelpMessage = "True if the image from which the OS disk is created supports accelerated networking.")] public bool? AcceleratedNetwork { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "Additional authentication requirements when exporting or uploading to a disk or snapshot.")] + [PSArgumentCompleter("AzureActiveDirectory", "None")] + public string DataAccessAuthMode { get; set; } + [Parameter( Mandatory = false, ValueFromPipelineByPropertyName = true, @@ -459,7 +466,8 @@ private void Run() PurchasePlan = this.IsParameterBound(c => c.PurchasePlan) ? this.PurchasePlan : null, SupportsHibernation = this.IsParameterBound(c => c.SupportsHibernation) ? SupportsHibernation : null, SupportedCapabilities = vSupportedCapabilities, - PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null + PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null, + DataAccessAuthMode = this.IsParameterBound(c => c.DataAccessAuthMode) ? DataAccessAuthMode : null }; WriteObject(vDisk); diff --git a/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskUpdateConfigCommand.cs b/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskUpdateConfigCommand.cs index 7764bebafe73..6952ba968868 100644 --- a/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskUpdateConfigCommand.cs +++ b/src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskUpdateConfigCommand.cs @@ -161,6 +161,13 @@ public partial class NewAzureRmDiskUpdateConfigCommand : Microsoft.Azure.Command HelpMessage = "True if the image from which the OS disk is created supports accelerated networking.")] public bool? AcceleratedNetwork { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "Additional authentication requirements when exporting or uploading to a disk or snapshot.")] + [PSArgumentCompleter("AzureActiveDirectory", "None")] + public string DataAccessAuthMode { get; set; } + [Parameter( Mandatory = false, ValueFromPipelineByPropertyName = true, @@ -310,7 +317,8 @@ private void Run() PurchasePlan = this.IsParameterBound(c => c.PurchasePlan) ? this.PurchasePlan : null, SupportsHibernation = this.IsParameterBound(c => c.SupportsHibernation) ? SupportsHibernation : null, SupportedCapabilities = vSupportedCapabilities, - PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null + PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null, + DataAccessAuthMode = this.IsParameterBound(c => c.DataAccessAuthMode) ? DataAccessAuthMode : null }; WriteObject(vDiskUpdate); diff --git a/src/Compute/Compute/Generated/Models/PSDisk.cs b/src/Compute/Compute/Generated/Models/PSDisk.cs index be823bb4ac0c..da4ab0879975 100644 --- a/src/Compute/Compute/Generated/Models/PSDisk.cs +++ b/src/Compute/Compute/Generated/Models/PSDisk.cs @@ -67,7 +67,6 @@ public string ResourceGroupName public string Location { get; set; } public ExtendedLocation ExtendedLocation { get; set; } public IDictionary Tags { get; set; } - // Gets or sets possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' public string NetworkAccessPolicy { get; set; } public string DiskAccessId { get; set; } public string Tier { get; set; } @@ -75,16 +74,8 @@ public string ResourceGroupName public PSPurchasePlan PurchasePlan { get; set; } public bool? SupportsHibernation { get; set; } public DiskSecurityProfile SecurityProfile { get; set; } - - // - // Summary: - // Gets or sets possible values include: 'Enabled', 'Disabled' public string PublicNetworkAccess { get; set; } - - // - // Summary: - // Gets or sets list of supported capabilities for the image from which the OS disk - // was created. public SupportedCapabilities SupportedCapabilities { get; set; } + public string DataAccessAuthMode { get; set; } } } diff --git a/src/Compute/Compute/Generated/Models/PSDiskUpdate.cs b/src/Compute/Compute/Generated/Models/PSDiskUpdate.cs index ad15201aa264..b8869c26d86c 100644 --- a/src/Compute/Compute/Generated/Models/PSDiskUpdate.cs +++ b/src/Compute/Compute/Generated/Models/PSDiskUpdate.cs @@ -56,5 +56,6 @@ public partial class PSDiskUpdate // Summary: // Gets or sets possible values include: 'Enabled', 'Disabled' public string PublicNetworkAccess { get; set; } + public string DataAccessAuthMode { get; set; } } } diff --git a/src/Compute/Compute/Generated/Models/PSSnapshot.cs b/src/Compute/Compute/Generated/Models/PSSnapshot.cs index dd0064e57011..bf0bcbfe93d7 100644 --- a/src/Compute/Compute/Generated/Models/PSSnapshot.cs +++ b/src/Compute/Compute/Generated/Models/PSSnapshot.cs @@ -81,6 +81,6 @@ public string ResourceGroupName // Gets or sets percentage complete for the background copy when a resource is created // via the CopyStart operation. public double? CompletionPercent { get; set; } - + public string DataAccessAuthMode { get; set; } } } diff --git a/src/Compute/Compute/Generated/Models/PSSnapshotUpdate.cs b/src/Compute/Compute/Generated/Models/PSSnapshotUpdate.cs index 68c7327cff02..349109733cfb 100644 --- a/src/Compute/Compute/Generated/Models/PSSnapshotUpdate.cs +++ b/src/Compute/Compute/Generated/Models/PSSnapshotUpdate.cs @@ -40,5 +40,6 @@ public partial class PSSnapshotUpdate // Summary: // Gets or sets possible values include: 'Enabled', 'Disabled' public string PublicNetworkAccess { get; set; } + public string DataAccessAuthMode { get; set; } } } diff --git a/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotConfigCommand.cs b/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotConfigCommand.cs index ffb38ca25e08..9cb5b6ee1a95 100644 --- a/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotConfigCommand.cs +++ b/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotConfigCommand.cs @@ -173,6 +173,13 @@ public partial class NewAzureRmSnapshotConfigCommand : Microsoft.Azure.Commands. HelpMessage = "True if the image from which the OS disk is created supports accelerated networking.")] public bool? AcceleratedNetwork { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "Additional authentication requirements when exporting or uploading to a disk or snapshot.")] + [PSArgumentCompleter("AzureActiveDirectory", "None")] + public string DataAccessAuthMode { get; set; } + [Parameter( Mandatory = false, ValueFromPipelineByPropertyName = true, @@ -370,7 +377,8 @@ private void Run() PurchasePlan = this.IsParameterBound(c => c.PurchasePlan) ? this.PurchasePlan : null, SupportsHibernation = this.IsParameterBound(c => c.SupportsHibernation) ? SupportsHibernation : null, SupportedCapabilities = vSupportedCapabilities, - PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null + PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null, + DataAccessAuthMode = this.IsParameterBound(c => c.DataAccessAuthMode) ? DataAccessAuthMode : null }; WriteObject(vSnapshot); diff --git a/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotUpdateConfigCommand.cs b/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotUpdateConfigCommand.cs index 1c9c1aa2cd80..7f47bb3c1f41 100644 --- a/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotUpdateConfigCommand.cs +++ b/src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotUpdateConfigCommand.cs @@ -101,6 +101,13 @@ public partial class NewAzureRmSnapshotUpdateConfigCommand : Microsoft.Azure.Com [PSArgumentCompleter("Enabled", "Disabled")] public string PublicNetworkAccess { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "Additional authentication requirements when exporting or uploading to a disk or snapshot.")] + [PSArgumentCompleter("AzureActiveDirectory", "None")] + public string DataAccessAuthMode { get; set; } + [Parameter( Mandatory = false, ValueFromPipelineByPropertyName = true, @@ -221,6 +228,7 @@ private void Run() Sku = vSku, SupportsHibernation = this.IsParameterBound(c => c.SupportsHibernation) ? SupportsHibernation : null, PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null, + DataAccessAuthMode = this.IsParameterBound(c => c.DataAccessAuthMode) ? DataAccessAuthMode : null, SupportedCapabilities = vSupportedCapabilities }; diff --git a/src/Compute/Compute/StorageServices/AddAzureVhdCommand.cs b/src/Compute/Compute/StorageServices/AddAzureVhdCommand.cs index 65dabad7a4d1..9fb4e53b4aab 100644 --- a/src/Compute/Compute/StorageServices/AddAzureVhdCommand.cs +++ b/src/Compute/Compute/StorageServices/AddAzureVhdCommand.cs @@ -102,7 +102,7 @@ public class AddAzureVhdCommand : ComputeClientBaseCmdlet public string DiskName { get; set; } [Parameter( - Mandatory = true, + Mandatory = true, Position = 1, ParameterSetName = DirectUploadToManagedDiskSet, ValueFromPipelineByPropertyName = true, @@ -461,7 +461,7 @@ private void CheckForInvalidVhd() try { bool resizeNeeded = false; - long resizeTo=0; + long resizeTo = 0; using (VirtualDiskStream vds = new VirtualDiskStream(filePath.FullName)) { if (vds.Length < 20971520 || vds.Length > 4396972769280) @@ -640,4 +640,4 @@ private void resizeVhdFile(long FileSize) } } } -} +} \ No newline at end of file diff --git a/src/Compute/Compute/help/New-AzDiskConfig.md b/src/Compute/Compute/help/New-AzDiskConfig.md index 6a846124fef7..3dfd57364ab9 100644 --- a/src/Compute/Compute/help/New-AzDiskConfig.md +++ b/src/Compute/Compute/help/New-AzDiskConfig.md @@ -24,8 +24,8 @@ New-AzDiskConfig [[-SkuName] ] [-Tier ] [-LogicalSectorSize ] [-KeyEncryptionKey ] [-DiskEncryptionSetId ] [-EncryptionType ] [-DiskAccessId ] [-NetworkAccessPolicy ] [-BurstingEnabled ] [-PublicNetworkAccess ] - [-AcceleratedNetwork ] [-Architecture ] [-DefaultProfile ] [-WhatIf] - [-Confirm] [] + [-AcceleratedNetwork ] [-DataAccessAuthMode ] [-Architecture ] [-DefaultProfile ] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -143,6 +143,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -DataAccessAuthMode +Additional authentication requirements when exporting or uploading to a disk or snapshot. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with azure. diff --git a/src/Compute/Compute/help/New-AzDiskUpdateConfig.md b/src/Compute/Compute/help/New-AzDiskUpdateConfig.md index 280e3d9a052a..2354cee75e65 100644 --- a/src/Compute/Compute/help/New-AzDiskUpdateConfig.md +++ b/src/Compute/Compute/help/New-AzDiskUpdateConfig.md @@ -20,7 +20,8 @@ New-AzDiskUpdateConfig [[-SkuName] ] [-Tier ] [-DiskIOPSReadOnly [-EncryptionSettingsEnabled ] [-DiskEncryptionKey ] [-KeyEncryptionKey ] [-DiskEncryptionSetId ] [-EncryptionType ] [-BurstingEnabled ] [-PublicNetworkAccess ] [-AcceleratedNetwork ] - [-Architecture ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-DataAccessAuthMode ] [-Architecture ] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -100,6 +101,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -DataAccessAuthMode +Additional authentication requirements when exporting or uploading to a disk or snapshot. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with azure. diff --git a/src/Compute/Compute/help/New-AzSnapshotConfig.md b/src/Compute/Compute/help/New-AzSnapshotConfig.md index dd8dcac7e817..e91d6a48b3f9 100644 --- a/src/Compute/Compute/help/New-AzSnapshotConfig.md +++ b/src/Compute/Compute/help/New-AzSnapshotConfig.md @@ -21,7 +21,8 @@ New-AzSnapshotConfig [[-SkuName] ] [[-OsType] ] [[ [-DiskEncryptionKey ] [-KeyEncryptionKey ] [-DiskEncryptionSetId ] [-EncryptionType ] [-DiskAccessId ] [-NetworkAccessPolicy ] [-PublicNetworkAccess ] [-AcceleratedNetwork ] - [-Architecture ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-DataAccessAuthMode ] [-Architecture ] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -101,6 +102,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -DataAccessAuthMode +Additional authentication requirements when exporting or uploading to a disk or snapshot. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with azure. diff --git a/src/Compute/Compute/help/New-AzSnapshotUpdateConfig.md b/src/Compute/Compute/help/New-AzSnapshotUpdateConfig.md index ee4741603b39..a78ceff59f43 100644 --- a/src/Compute/Compute/help/New-AzSnapshotUpdateConfig.md +++ b/src/Compute/Compute/help/New-AzSnapshotUpdateConfig.md @@ -17,7 +17,8 @@ New-AzSnapshotUpdateConfig [[-SkuName] ] [[-OsType] ] [-SupportsHibernation ] [-EncryptionSettingsEnabled ] [-DiskEncryptionKey ] [-KeyEncryptionKey ] [-DiskEncryptionSetId ] [-EncryptionType ] [-PublicNetworkAccess ] - [-Architecture ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-DataAccessAuthMode ] [-Architecture ] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -68,6 +69,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -DataAccessAuthMode +Additional authentication requirements when exporting or uploading to a disk or snapshot. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with azure. From 75d7b7095cfdc43bf43fda0728bda1b52dd0df0b Mon Sep 17 00:00:00 2001 From: Yunchi Wang <54880216+wyunchi-ms@users.noreply.github.com> Date: Fri, 13 May 2022 09:22:38 +0800 Subject: [PATCH 5/5] Update ChangeLog.md --- src/Compute/Compute/ChangeLog.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index b9ac7bba315c..3611abcbfcac 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -21,17 +21,17 @@ --> ## Upcoming Release * Edited `New-AzVm` cmdlet internal logic to use the `PlatformFaultDomain` value in the `PSVirtualMachine` object passed to it in the new virtual machine. -* Add `-DataAccessAuthMode` parameter to the following cmdlets: - - New-AzDiskConfig - - New-AzDiskUpdateConfig - - New-AzSnapshotConfig - - New-AzSnapshotUpdateConfig +* Added `-DataAccessAuthMode` parameter to the following cmdlets: + - `New-AzDiskConfig` + - `New-AzDiskUpdateConfig` + - `New-AzSnapshotConfig` + - `New-AzSnapshotUpdateConfig` * Added `-Architecture` parameter to the following cmdlets: - - New-AzDiskConfig`` - - New-AzDiskUpdateConfig - - New-AzSnapshotConfig - - New-AzSnapshotUpdateConfig - - New-AzGalleryImageDefinition + - `New-AzDiskConfig` + - `New-AzDiskUpdateConfig` + - `New-AzSnapshotConfig` + - `New-AzSnapshotUpdateConfig` + - `New-AzGalleryImageDefinition` ## Version 4.26.0 * Added `-ImageReferenceId` parameter to following cmdlets: `New-AzVm`, `New-AzVmConfig`, `New-AzVmss`, `Set-AzVmssStorageProfile`