Skip to content

Commit e6a6ae8

Browse files
Add Arm64 and DataAccessAuthMode feature for Compute cmdlets (#18131)
* updates to cmdlets * fix NewGalleryImage instead of update, add md files, update changelog * update last md * 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 * Update ChangeLog.md Co-authored-by: Yunchi Wang <[email protected]>
1 parent 7ea5b5b commit e6a6ae8

18 files changed

+282
-25
lines changed

src/Compute/Compute/ChangeLog.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@
2121
-->
2222
## Upcoming Release
2323
* Edited `New-AzVm` cmdlet internal logic to use the `PlatformFaultDomain` value in the `PSVirtualMachine` object passed to it in the new virtual machine.
24+
* Added `-DataAccessAuthMode` parameter to the following cmdlets:
25+
- `New-AzDiskConfig`
26+
- `New-AzDiskUpdateConfig`
27+
- `New-AzSnapshotConfig`
28+
- `New-AzSnapshotUpdateConfig`
29+
* Added `-Architecture` parameter to the following cmdlets:
30+
- `New-AzDiskConfig`
31+
- `New-AzDiskUpdateConfig`
32+
- `New-AzSnapshotConfig`
33+
- `New-AzSnapshotUpdateConfig`
34+
- `New-AzGalleryImageDefinition`
2435

2536
## Version 4.26.0
2637
* Added `-ImageReferenceId` parameter to following cmdlets: `New-AzVm`, `New-AzVmConfig`, `New-AzVmss`, `Set-AzVmssStorageProfile`

src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskConfigCommand.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,20 @@ public partial class NewAzureRmDiskConfigCommand : Microsoft.Azure.Commands.Reso
228228
HelpMessage = "True if the image from which the OS disk is created supports accelerated networking.")]
229229
public bool? AcceleratedNetwork { get; set; }
230230

231+
[Parameter(
232+
Mandatory = false,
233+
ValueFromPipelineByPropertyName = true,
234+
HelpMessage = "Additional authentication requirements when exporting or uploading to a disk or snapshot.")]
235+
[PSArgumentCompleter("AzureActiveDirectory", "None")]
236+
public string DataAccessAuthMode { get; set; }
237+
238+
[Parameter(
239+
Mandatory = false,
240+
ValueFromPipelineByPropertyName = true,
241+
HelpMessage = "CPU architecture supported by an OS disk. Possible values are \"X64\" and \"Arm64\".")]
242+
[PSArgumentCompleter("X64", "Arm64")]
243+
public string Architecture { get; set; }
244+
231245
protected override void ProcessRecord()
232246
{
233247
if (ShouldProcess("Disk", "New"))
@@ -418,6 +432,15 @@ private void Run()
418432
vSupportedCapabilities.AcceleratedNetwork = AcceleratedNetwork;
419433
}
420434

435+
if (this.IsParameterBound(c => c.Architecture))
436+
{
437+
if (vSupportedCapabilities == null)
438+
{
439+
vSupportedCapabilities = new SupportedCapabilities();
440+
}
441+
vSupportedCapabilities.Architecture = this.Architecture;
442+
}
443+
421444
var vDisk = new PSDisk
422445
{
423446
Zones = this.IsParameterBound(c => c.Zone) ? this.Zone : null,
@@ -443,7 +466,8 @@ private void Run()
443466
PurchasePlan = this.IsParameterBound(c => c.PurchasePlan) ? this.PurchasePlan : null,
444467
SupportsHibernation = this.IsParameterBound(c => c.SupportsHibernation) ? SupportsHibernation : null,
445468
SupportedCapabilities = vSupportedCapabilities,
446-
PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null
469+
PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null,
470+
DataAccessAuthMode = this.IsParameterBound(c => c.DataAccessAuthMode) ? DataAccessAuthMode : null
447471
};
448472

449473
WriteObject(vDisk);

src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskUpdateConfigCommand.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,20 @@ public partial class NewAzureRmDiskUpdateConfigCommand : Microsoft.Azure.Command
161161
HelpMessage = "True if the image from which the OS disk is created supports accelerated networking.")]
162162
public bool? AcceleratedNetwork { get; set; }
163163

164+
[Parameter(
165+
Mandatory = false,
166+
ValueFromPipelineByPropertyName = true,
167+
HelpMessage = "Additional authentication requirements when exporting or uploading to a disk or snapshot.")]
168+
[PSArgumentCompleter("AzureActiveDirectory", "None")]
169+
public string DataAccessAuthMode { get; set; }
170+
171+
[Parameter(
172+
Mandatory = false,
173+
ValueFromPipelineByPropertyName = true,
174+
HelpMessage = "CPU architecture supported by an OS disk. Possible values are \"X64\" and \"Arm64\".")]
175+
[PSArgumentCompleter("X64", "Arm64")]
176+
public string Architecture { get; set; }
177+
164178

165179
protected override void ProcessRecord()
166180
{
@@ -274,6 +288,15 @@ private void Run()
274288
vSupportedCapabilities.AcceleratedNetwork = AcceleratedNetwork;
275289
}
276290

291+
if (this.IsParameterBound(c => c.Architecture))
292+
{
293+
if (vSupportedCapabilities == null)
294+
{
295+
vSupportedCapabilities = new SupportedCapabilities();
296+
}
297+
vSupportedCapabilities.Architecture = this.Architecture;
298+
}
299+
277300
var vDiskUpdate = new PSDiskUpdate
278301
{
279302
OsType = this.IsParameterBound(c => c.OsType) ? this.OsType : (OperatingSystemTypes?)null,
@@ -294,7 +317,8 @@ private void Run()
294317
PurchasePlan = this.IsParameterBound(c => c.PurchasePlan) ? this.PurchasePlan : null,
295318
SupportsHibernation = this.IsParameterBound(c => c.SupportsHibernation) ? SupportsHibernation : null,
296319
SupportedCapabilities = vSupportedCapabilities,
297-
PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null
320+
PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null,
321+
DataAccessAuthMode = this.IsParameterBound(c => c.DataAccessAuthMode) ? DataAccessAuthMode : null
298322
};
299323

300324
WriteObject(vDiskUpdate);

src/Compute/Compute/Generated/GalleryImage/GalleryImageCreateOrUpdateMethod.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ public override void ExecuteCmdlet()
8383
galleryImage.EndOfLifeDate = this.EndOfLifeDate;
8484
}
8585

86+
if (this.IsParameterBound(c => c.Architecture))
87+
{
88+
galleryImage.Architecture = this.Architecture;
89+
}
90+
8691
if (this.IsParameterBound(c => c.Tag))
8792
{
8893
galleryImage.Tags = this.Tag.Cast<DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value);
@@ -327,6 +332,13 @@ public override void ExecuteCmdlet()
327332
Mandatory = false,
328333
ValueFromPipelineByPropertyName = true)]
329334
public GalleryImageFeature[] Feature { get; set; }
335+
336+
[Parameter(
337+
Mandatory = false,
338+
ValueFromPipelineByPropertyName = true,
339+
HelpMessage = "CPU architecture supported by an OS disk. Possible values are \"X64\" and \"Arm64\".")]
340+
[PSArgumentCompleter("X64", "Arm64")]
341+
public string Architecture { get; set; }
330342
}
331343

332344
[Cmdlet(VerbsData.Update, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "GalleryImageDefinition", DefaultParameterSetName = "DefaultParameter", SupportsShouldProcess = true)]

src/Compute/Compute/Generated/Models/PSDisk.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,15 @@ public string ResourceGroupName
6767
public string Location { get; set; }
6868
public ExtendedLocation ExtendedLocation { get; set; }
6969
public IDictionary<string, string> Tags { get; set; }
70-
// Gets or sets possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll'
7170
public string NetworkAccessPolicy { get; set; }
7271
public string DiskAccessId { get; set; }
7372
public string Tier { get; set; }
7473
public bool? BurstingEnabled { get; set; }
7574
public PSPurchasePlan PurchasePlan { get; set; }
7675
public bool? SupportsHibernation { get; set; }
7776
public DiskSecurityProfile SecurityProfile { get; set; }
78-
79-
//
80-
// Summary:
81-
// Gets or sets possible values include: 'Enabled', 'Disabled'
8277
public string PublicNetworkAccess { get; set; }
83-
84-
//
85-
// Summary:
86-
// Gets or sets list of supported capabilities for the image from which the OS disk
87-
// was created.
8878
public SupportedCapabilities SupportedCapabilities { get; set; }
79+
public string DataAccessAuthMode { get; set; }
8980
}
9081
}

src/Compute/Compute/Generated/Models/PSDiskUpdate.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@ public partial class PSDiskUpdate
5656
// Summary:
5757
// Gets or sets possible values include: 'Enabled', 'Disabled'
5858
public string PublicNetworkAccess { get; set; }
59+
public string DataAccessAuthMode { get; set; }
5960
}
6061
}

src/Compute/Compute/Generated/Models/PSGalleryImage.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public string ResourceGroupName
5959
public string Location { get; set; }
6060
public IDictionary<string, string> Tags { get; set; }
6161
public IList<GalleryImageFeature> Features { get; set; }
62+
public string Architecture { get; set; }
6263

6364
}
6465
}

src/Compute/Compute/Generated/Models/PSSnapshot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ public string ResourceGroupName
8181
// Gets or sets percentage complete for the background copy when a resource is created
8282
// via the CopyStart operation.
8383
public double? CompletionPercent { get; set; }
84-
84+
public string DataAccessAuthMode { get; set; }
8585
}
8686
}

src/Compute/Compute/Generated/Models/PSSnapshotUpdate.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ public partial class PSSnapshotUpdate
3434
public IDictionary<string, string> Tags { get; set; }
3535
public SnapshotSku Sku { get; set; }
3636
public bool? SupportsHibernation { get; set; }
37+
public SupportedCapabilities SupportedCapabilities { get; set; }
3738

3839
//
3940
// Summary:
4041
// Gets or sets possible values include: 'Enabled', 'Disabled'
4142
public string PublicNetworkAccess { get; set; }
43+
public string DataAccessAuthMode { get; set; }
4244
}
4345
}

src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotConfigCommand.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,20 @@ public partial class NewAzureRmSnapshotConfigCommand : Microsoft.Azure.Commands.
173173
HelpMessage = "True if the image from which the OS disk is created supports accelerated networking.")]
174174
public bool? AcceleratedNetwork { get; set; }
175175

176+
[Parameter(
177+
Mandatory = false,
178+
ValueFromPipelineByPropertyName = true,
179+
HelpMessage = "Additional authentication requirements when exporting or uploading to a disk or snapshot.")]
180+
[PSArgumentCompleter("AzureActiveDirectory", "None")]
181+
public string DataAccessAuthMode { get; set; }
182+
183+
[Parameter(
184+
Mandatory = false,
185+
ValueFromPipelineByPropertyName = true,
186+
HelpMessage = "CPU architecture supported by an OS disk. Possible values are \"X64\" and \"Arm64\".")]
187+
[PSArgumentCompleter("X64", "Arm64")]
188+
public string Architecture { get; set; }
189+
176190
protected override void ProcessRecord()
177191
{
178192
if (ShouldProcess("Snapshot", "New"))
@@ -336,6 +350,15 @@ private void Run()
336350
vSupportedCapabilities.AcceleratedNetwork = AcceleratedNetwork;
337351
}
338352

353+
if (this.IsParameterBound(c => c.Architecture))
354+
{
355+
if (vSupportedCapabilities == null)
356+
{
357+
vSupportedCapabilities = new SupportedCapabilities();
358+
}
359+
vSupportedCapabilities.Architecture = this.Architecture;
360+
}
361+
339362
var vSnapshot = new PSSnapshot
340363
{
341364
OsType = this.IsParameterBound(c => c.OsType) ? this.OsType : (OperatingSystemTypes?)null,
@@ -354,7 +377,8 @@ private void Run()
354377
PurchasePlan = this.IsParameterBound(c => c.PurchasePlan) ? this.PurchasePlan : null,
355378
SupportsHibernation = this.IsParameterBound(c => c.SupportsHibernation) ? SupportsHibernation : null,
356379
SupportedCapabilities = vSupportedCapabilities,
357-
PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null
380+
PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null,
381+
DataAccessAuthMode = this.IsParameterBound(c => c.DataAccessAuthMode) ? DataAccessAuthMode : null
358382
};
359383

360384
WriteObject(vSnapshot);

src/Compute/Compute/Generated/Snapshot/Config/NewAzureRmSnapshotUpdateConfigCommand.cs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,20 @@ public partial class NewAzureRmSnapshotUpdateConfigCommand : Microsoft.Azure.Com
101101
[PSArgumentCompleter("Enabled", "Disabled")]
102102
public string PublicNetworkAccess { get; set; }
103103

104+
[Parameter(
105+
Mandatory = false,
106+
ValueFromPipelineByPropertyName = true,
107+
HelpMessage = "Additional authentication requirements when exporting or uploading to a disk or snapshot.")]
108+
[PSArgumentCompleter("AzureActiveDirectory", "None")]
109+
public string DataAccessAuthMode { get; set; }
110+
111+
[Parameter(
112+
Mandatory = false,
113+
ValueFromPipelineByPropertyName = true,
114+
HelpMessage = "CPU architecture supported by an OS disk. Possible values are \"X64\" and \"Arm64\".")]
115+
[PSArgumentCompleter("X64", "Arm64")]
116+
public string Architecture { get; set; }
117+
104118
protected override void ProcessRecord()
105119
{
106120
if (ShouldProcess("SnapshotUpdate", "New"))
@@ -120,6 +134,8 @@ private void Run()
120134
// Sku
121135
SnapshotSku vSku = null;
122136

137+
SupportedCapabilities vSupportedCapabilities = null;
138+
123139
if (this.IsParameterBound(c => c.EncryptionSettingsEnabled))
124140
{
125141
if (vEncryptionSettingsCollection == null)
@@ -193,6 +209,15 @@ private void Run()
193209
vSku.Name = this.SkuName;
194210
}
195211

212+
if (this.IsParameterBound(c => c.Architecture))
213+
{
214+
if (vSupportedCapabilities == null)
215+
{
216+
vSupportedCapabilities = new SupportedCapabilities();
217+
}
218+
vSupportedCapabilities.Architecture = this.Architecture;
219+
}
220+
196221
var vSnapshotUpdate = new PSSnapshotUpdate
197222
{
198223
OsType = this.IsParameterBound(c => c.OsType) ? this.OsType : (OperatingSystemTypes?)null,
@@ -202,7 +227,9 @@ private void Run()
202227
Encryption = vEncryption,
203228
Sku = vSku,
204229
SupportsHibernation = this.IsParameterBound(c => c.SupportsHibernation) ? SupportsHibernation : null,
205-
PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null
230+
PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null,
231+
DataAccessAuthMode = this.IsParameterBound(c => c.DataAccessAuthMode) ? DataAccessAuthMode : null,
232+
SupportedCapabilities = vSupportedCapabilities
206233
};
207234

208235
WriteObject(vSnapshotUpdate);

src/Compute/Compute/Models/PSVirtualMachineImage.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,7 @@ public string DataDiskImagesText
8181
}
8282

8383
public AutomaticOSUpgradeProperties AutomaticOSUpgradeProperties { get; set; }
84+
85+
public string Architecture { get; set; }
8486
}
8587
}

src/Compute/Compute/StorageServices/AddAzureVhdCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public class AddAzureVhdCommand : ComputeClientBaseCmdlet
102102
public string DiskName { get; set; }
103103

104104
[Parameter(
105-
Mandatory = true,
105+
Mandatory = true,
106106
Position = 1,
107107
ParameterSetName = DirectUploadToManagedDiskSet,
108108
ValueFromPipelineByPropertyName = true,
@@ -461,7 +461,7 @@ private void CheckForInvalidVhd()
461461
try
462462
{
463463
bool resizeNeeded = false;
464-
long resizeTo=0;
464+
long resizeTo = 0;
465465
using (VirtualDiskStream vds = new VirtualDiskStream(filePath.FullName))
466466
{
467467
if (vds.Length < 20971520 || vds.Length > 4396972769280)
@@ -640,4 +640,4 @@ private void resizeVhdFile(long FileSize)
640640
}
641641
}
642642
}
643-
}
643+
}

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

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ New-AzDiskConfig [[-SkuName] <String>] [-Tier <String>] [-LogicalSectorSize <Int
2424
[-DiskEncryptionKey <KeyVaultAndSecretReference>] [-KeyEncryptionKey <KeyVaultAndKeyReference>]
2525
[-DiskEncryptionSetId <String>] [-EncryptionType <String>] [-DiskAccessId <String>]
2626
[-NetworkAccessPolicy <String>] [-BurstingEnabled <Boolean>] [-PublicNetworkAccess <String>]
27-
[-AcceleratedNetwork <Boolean>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
28-
[<CommonParameters>]
27+
[-AcceleratedNetwork <Boolean>] [-DataAccessAuthMode <String>] [-Architecture <String>] [-DefaultProfile <IAzureContextContainer>]
28+
[-WhatIf] [-Confirm] [<CommonParameters>]
2929
```
3030

3131
## DESCRIPTION
@@ -97,6 +97,21 @@ Accept pipeline input: True (ByPropertyName)
9797
Accept wildcard characters: False
9898
```
9999
100+
### -Architecture
101+
CPU architecture supported by an OS disk. Possible values are "X64" and "Arm64".
102+
103+
```yaml
104+
Type: System.String
105+
Parameter Sets: (All)
106+
Aliases:
107+
108+
Required: False
109+
Position: Named
110+
Default value: None
111+
Accept pipeline input: True (ByPropertyName)
112+
Accept wildcard characters: False
113+
```
114+
100115
### -BurstingEnabled
101116
Enables bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks.
102117
@@ -128,6 +143,21 @@ Accept pipeline input: True (ByPropertyName)
128143
Accept wildcard characters: False
129144
```
130145
146+
### -DataAccessAuthMode
147+
Additional authentication requirements when exporting or uploading to a disk or snapshot.
148+
149+
```yaml
150+
Type: System.String
151+
Parameter Sets: (All)
152+
Aliases:
153+
154+
Required: False
155+
Position: Named
156+
Default value: None
157+
Accept pipeline input: True (ByPropertyName)
158+
Accept wildcard characters: False
159+
```
160+
131161
### -DefaultProfile
132162
The credentials, account, tenant, and subscription used for communication with azure.
133163

0 commit comments

Comments
 (0)