Skip to content

Commit

Permalink
Feature/cplat data auth access (#18137)
Browse files Browse the repository at this point in the history
* add -DataAccessAuthMode to Snaptshot/Disk config/updateConfig

* trying DataAuth in Add-AzVhd

* progress save for Add-AzVhd

* remove add-azvhd stuff

* md files
  • Loading branch information
grizzlytheodore authored May 12, 2022
1 parent aef5121 commit 58d19de
Show file tree
Hide file tree
Showing 14 changed files with 115 additions and 22 deletions.
5 changes: 5 additions & 0 deletions src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
11 changes: 1 addition & 10 deletions src/Compute/Compute/Generated/Models/PSDisk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,15 @@ public string ResourceGroupName
public string Location { get; set; }
public ExtendedLocation ExtendedLocation { get; set; }
public IDictionary<string, string> 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; }
public bool? BurstingEnabled { get; set; }
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; }
}
}
1 change: 1 addition & 0 deletions src/Compute/Compute/Generated/Models/PSDiskUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
2 changes: 1 addition & 1 deletion src/Compute/Compute/Generated/Models/PSSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
1 change: 1 addition & 0 deletions src/Compute/Compute/Generated/Models/PSSnapshotUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
};

Expand Down
6 changes: 3 additions & 3 deletions src/Compute/Compute/StorageServices/AddAzureVhdCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class AddAzureVhdCommand : ComputeClientBaseCmdlet
public string DiskName { get; set; }

[Parameter(
Mandatory = true,
Mandatory = true,
Position = 1,
ParameterSetName = DirectUploadToManagedDiskSet,
ValueFromPipelineByPropertyName = true,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -640,4 +640,4 @@ private void resizeVhdFile(long FileSize)
}
}
}
}
}
19 changes: 17 additions & 2 deletions src/Compute/Compute/help/New-AzDiskConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ New-AzDiskConfig [[-SkuName] <String>] [-Tier <String>] [-LogicalSectorSize <Int
[-DiskEncryptionKey <KeyVaultAndSecretReference>] [-KeyEncryptionKey <KeyVaultAndKeyReference>]
[-DiskEncryptionSetId <String>] [-EncryptionType <String>] [-DiskAccessId <String>]
[-NetworkAccessPolicy <String>] [-BurstingEnabled <Boolean>] [-PublicNetworkAccess <String>]
[-AcceleratedNetwork <Boolean>] [-Architecture <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
[-Confirm] [<CommonParameters>]
[-AcceleratedNetwork <Boolean>] [-DataAccessAuthMode <String>] [-Architecture <String>] [-DefaultProfile <IAzureContextContainer>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -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.
Expand Down
18 changes: 17 additions & 1 deletion src/Compute/Compute/help/New-AzDiskUpdateConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ New-AzDiskUpdateConfig [[-SkuName] <String>] [-Tier <String>] [-DiskIOPSReadOnly
[-EncryptionSettingsEnabled <Boolean>] [-DiskEncryptionKey <KeyVaultAndSecretReference>]
[-KeyEncryptionKey <KeyVaultAndKeyReference>] [-DiskEncryptionSetId <String>] [-EncryptionType <String>]
[-BurstingEnabled <Boolean>] [-PublicNetworkAccess <String>] [-AcceleratedNetwork <Boolean>]
[-Architecture <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-DataAccessAuthMode <String>] [-Architecture <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -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.
Expand Down
18 changes: 17 additions & 1 deletion src/Compute/Compute/help/New-AzSnapshotConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ New-AzSnapshotConfig [[-SkuName] <String>] [[-OsType] <OperatingSystemTypes>] [[
[-DiskEncryptionKey <KeyVaultAndSecretReference>] [-KeyEncryptionKey <KeyVaultAndKeyReference>]
[-DiskEncryptionSetId <String>] [-EncryptionType <String>] [-DiskAccessId <String>]
[-NetworkAccessPolicy <String>] [-PublicNetworkAccess <String>] [-AcceleratedNetwork <Boolean>]
[-Architecture <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-DataAccessAuthMode <String>] [-Architecture <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -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.
Expand Down
18 changes: 17 additions & 1 deletion src/Compute/Compute/help/New-AzSnapshotUpdateConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ New-AzSnapshotUpdateConfig [[-SkuName] <String>] [[-OsType] <OperatingSystemType
[[-Tag] <Hashtable>] [-SupportsHibernation <Boolean>] [-EncryptionSettingsEnabled <Boolean>]
[-DiskEncryptionKey <KeyVaultAndSecretReference>] [-KeyEncryptionKey <KeyVaultAndKeyReference>]
[-DiskEncryptionSetId <String>] [-EncryptionType <String>] [-PublicNetworkAccess <String>]
[-Architecture <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-DataAccessAuthMode <String>] [-Architecture <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 58d19de

Please sign in to comment.