Skip to content

Commit 58d19de

Browse files
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
1 parent aef5121 commit 58d19de

14 files changed

+115
-22
lines changed

src/Compute/Compute/ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
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+
* Add `-DataAccessAuthMode` parameter to the following cmdlets:
25+
- New-AzDiskConfig
26+
- New-AzDiskUpdateConfig
27+
- New-AzSnapshotConfig
28+
- New-AzSnapshotUpdateConfig
2429
* Added `-Architecture` parameter to the following cmdlets:
2530
- New-AzDiskConfig``
2631
- New-AzDiskUpdateConfig

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,13 @@ 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+
231238
[Parameter(
232239
Mandatory = false,
233240
ValueFromPipelineByPropertyName = true,
@@ -459,7 +466,8 @@ private void Run()
459466
PurchasePlan = this.IsParameterBound(c => c.PurchasePlan) ? this.PurchasePlan : null,
460467
SupportsHibernation = this.IsParameterBound(c => c.SupportsHibernation) ? SupportsHibernation : null,
461468
SupportedCapabilities = vSupportedCapabilities,
462-
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
463471
};
464472

465473
WriteObject(vDisk);

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ 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+
164171
[Parameter(
165172
Mandatory = false,
166173
ValueFromPipelineByPropertyName = true,
@@ -310,7 +317,8 @@ private void Run()
310317
PurchasePlan = this.IsParameterBound(c => c.PurchasePlan) ? this.PurchasePlan : null,
311318
SupportsHibernation = this.IsParameterBound(c => c.SupportsHibernation) ? SupportsHibernation : null,
312319
SupportedCapabilities = vSupportedCapabilities,
313-
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
314322
};
315323

316324
WriteObject(vDiskUpdate);

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/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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@ public partial class PSSnapshotUpdate
4040
// Summary:
4141
// Gets or sets possible values include: 'Enabled', 'Disabled'
4242
public string PublicNetworkAccess { get; set; }
43+
public string DataAccessAuthMode { get; set; }
4344
}
4445
}

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,13 @@ 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+
176183
[Parameter(
177184
Mandatory = false,
178185
ValueFromPipelineByPropertyName = true,
@@ -370,7 +377,8 @@ private void Run()
370377
PurchasePlan = this.IsParameterBound(c => c.PurchasePlan) ? this.PurchasePlan : null,
371378
SupportsHibernation = this.IsParameterBound(c => c.SupportsHibernation) ? SupportsHibernation : null,
372379
SupportedCapabilities = vSupportedCapabilities,
373-
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
374382
};
375383

376384
WriteObject(vSnapshot);

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ 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+
104111
[Parameter(
105112
Mandatory = false,
106113
ValueFromPipelineByPropertyName = true,
@@ -221,6 +228,7 @@ private void Run()
221228
Sku = vSku,
222229
SupportsHibernation = this.IsParameterBound(c => c.SupportsHibernation) ? SupportsHibernation : null,
223230
PublicNetworkAccess = this.IsParameterBound(c => c.PublicNetworkAccess) ? PublicNetworkAccess : null,
231+
DataAccessAuthMode = this.IsParameterBound(c => c.DataAccessAuthMode) ? DataAccessAuthMode : null,
224232
SupportedCapabilities = vSupportedCapabilities
225233
};
226234

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: 17 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>] [-Architecture <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
28-
[-Confirm] [<CommonParameters>]
27+
[-AcceleratedNetwork <Boolean>] [-DataAccessAuthMode <String>] [-Architecture <String>] [-DefaultProfile <IAzureContextContainer>]
28+
[-WhatIf] [-Confirm] [<CommonParameters>]
2929
```
3030

3131
## DESCRIPTION
@@ -143,6 +143,21 @@ Accept pipeline input: True (ByPropertyName)
143143
Accept wildcard characters: False
144144
```
145145
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+
146161
### -DefaultProfile
147162
The credentials, account, tenant, and subscription used for communication with azure.
148163

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ New-AzDiskUpdateConfig [[-SkuName] <String>] [-Tier <String>] [-DiskIOPSReadOnly
2020
[-EncryptionSettingsEnabled <Boolean>] [-DiskEncryptionKey <KeyVaultAndSecretReference>]
2121
[-KeyEncryptionKey <KeyVaultAndKeyReference>] [-DiskEncryptionSetId <String>] [-EncryptionType <String>]
2222
[-BurstingEnabled <Boolean>] [-PublicNetworkAccess <String>] [-AcceleratedNetwork <Boolean>]
23-
[-Architecture <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
23+
[-DataAccessAuthMode <String>] [-Architecture <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
24+
[<CommonParameters>]
2425
```
2526

2627
## DESCRIPTION
@@ -100,6 +101,21 @@ Accept pipeline input: True (ByPropertyName)
100101
Accept wildcard characters: False
101102
```
102103
104+
### -DataAccessAuthMode
105+
Additional authentication requirements when exporting or uploading to a disk or snapshot.
106+
107+
```yaml
108+
Type: System.String
109+
Parameter Sets: (All)
110+
Aliases:
111+
112+
Required: False
113+
Position: Named
114+
Default value: None
115+
Accept pipeline input: True (ByPropertyName)
116+
Accept wildcard characters: False
117+
```
118+
103119
### -DefaultProfile
104120
The credentials, account, tenant, and subscription used for communication with azure.
105121

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ New-AzSnapshotConfig [[-SkuName] <String>] [[-OsType] <OperatingSystemTypes>] [[
2121
[-DiskEncryptionKey <KeyVaultAndSecretReference>] [-KeyEncryptionKey <KeyVaultAndKeyReference>]
2222
[-DiskEncryptionSetId <String>] [-EncryptionType <String>] [-DiskAccessId <String>]
2323
[-NetworkAccessPolicy <String>] [-PublicNetworkAccess <String>] [-AcceleratedNetwork <Boolean>]
24-
[-Architecture <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
24+
[-DataAccessAuthMode <String>] [-Architecture <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
25+
[<CommonParameters>]
2526
```
2627

2728
## DESCRIPTION
@@ -101,6 +102,21 @@ Accept pipeline input: True (ByPropertyName)
101102
Accept wildcard characters: False
102103
```
103104
105+
### -DataAccessAuthMode
106+
Additional authentication requirements when exporting or uploading to a disk or snapshot.
107+
108+
```yaml
109+
Type: System.String
110+
Parameter Sets: (All)
111+
Aliases:
112+
113+
Required: False
114+
Position: Named
115+
Default value: None
116+
Accept pipeline input: True (ByPropertyName)
117+
Accept wildcard characters: False
118+
```
119+
104120
### -DefaultProfile
105121
The credentials, account, tenant, and subscription used for communication with azure.
106122

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ New-AzSnapshotUpdateConfig [[-SkuName] <String>] [[-OsType] <OperatingSystemType
1717
[[-Tag] <Hashtable>] [-SupportsHibernation <Boolean>] [-EncryptionSettingsEnabled <Boolean>]
1818
[-DiskEncryptionKey <KeyVaultAndSecretReference>] [-KeyEncryptionKey <KeyVaultAndKeyReference>]
1919
[-DiskEncryptionSetId <String>] [-EncryptionType <String>] [-PublicNetworkAccess <String>]
20-
[-Architecture <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
20+
[-DataAccessAuthMode <String>] [-Architecture <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
21+
[<CommonParameters>]
2122
```
2223

2324
## DESCRIPTION
@@ -68,6 +69,21 @@ Accept pipeline input: True (ByPropertyName)
6869
Accept wildcard characters: False
6970
```
7071
72+
### -DataAccessAuthMode
73+
Additional authentication requirements when exporting or uploading to a disk or snapshot.
74+
75+
```yaml
76+
Type: System.String
77+
Parameter Sets: (All)
78+
Aliases:
79+
80+
Required: False
81+
Position: Named
82+
Default value: None
83+
Accept pipeline input: True (ByPropertyName)
84+
Accept wildcard characters: False
85+
```
86+
7187
### -DefaultProfile
7288
The credentials, account, tenant, and subscription used for communication with azure.
7389

0 commit comments

Comments
 (0)