Skip to content

Introduce new SKUs and Generations for VirtualNetwork VPN gateways. #10106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ function Test-VirtualNetworkExpressRouteGatewayCRUD
$vnetName = Get-ResourceName
$publicIpName = Get-ResourceName
$vnetGatewayConfigName = Get-ResourceName
$rglocation = Get-ProviderLocation ResourceManagement "East US"
$rglocation = Get-ProviderLocation ResourceManagement "West Central US"
$resourceTypeParent = "Microsoft.Network/virtualNetworkGateways"
$location = Get-ProviderLocation $resourceTypeParent "East US"
$location = Get-ProviderLocation $resourceTypeParent "West Central US"

try
{
Expand All @@ -47,11 +47,12 @@ function Test-VirtualNetworkExpressRouteGatewayCRUD
# Create & Get virtualnetworkgateway
$vnetIpConfig = New-AzVirtualNetworkGatewayIpConfig -Name $vnetGatewayConfigName -PublicIpAddress $publicip -Subnet $subnet

$actual = New-AzVirtualNetworkGateway -ResourceGroupName $rgname -name $rname -location $location -IpConfigurations $vnetIpConfig -GatewayType ExpressRoute -GatewaySku UltraPerformance -VpnType RouteBased -Force
$actual = New-AzVirtualNetworkGateway -ResourceGroupName $rgname -name $rname -location $location -IpConfigurations $vnetIpConfig -GatewayType ExpressRoute -GatewaySku UltraPerformance -VpnType RouteBased -VpnGatewayGeneration None -Force
$expected = Get-AzVirtualNetworkGateway -ResourceGroupName $rgname -name $rname
Assert-AreEqual $expected.ResourceGroupName $actual.ResourceGroupName
Assert-AreEqual $expected.Name $actual.Name
Assert-AreEqual "ExpressRoute" $expected.GatewayType
Assert-AreEqual "None" $expected.VpnGatewayGeneration

# List virtualNetworkGateways
$list = Get-AzVirtualNetworkGateway -ResourceGroupName $rgname
Expand Down

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/Network/Network/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
- New-VpnConnection
- Update-VpnConnection
* Fixed documents for some PowerShell examples to use Az cmdlets instead of AzureRM cmdlets
* New Generations and SKUs for VirtualNetworkGateways
- Introduce new Generations for VirtualNetworkGateways.
- Introduce new high throughput SKUs for VirtualNetworkGateways.

## Version 1.13.0
* Updated New-AzPrivateLinkServiceIpConfig
Expand Down
2 changes: 2 additions & 0 deletions src/Network/Network/Models/PSVirtualNetworkGateway.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public class PSVirtualNetworkGateway : PSTopLevelResource

public PSAddressSpace CustomRoutes { get; set; }

public string VpnGatewayGeneration { get; set; }

[JsonIgnore]
public string IpConfigurationsText
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,13 @@ public class NewAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
MNM.VirtualNetworkGatewaySkuTier.VpnGw1,
MNM.VirtualNetworkGatewaySkuTier.VpnGw2,
MNM.VirtualNetworkGatewaySkuTier.VpnGw3,
MNM.VirtualNetworkGatewaySkuTier.VpnGw4,
MNM.VirtualNetworkGatewaySkuTier.VpnGw5,
MNM.VirtualNetworkGatewaySkuTier.VpnGw1AZ,
MNM.VirtualNetworkGatewaySkuTier.VpnGw2AZ,
MNM.VirtualNetworkGatewaySkuTier.VpnGw3AZ,
MNM.VirtualNetworkGatewaySkuTier.VpnGw4AZ,
MNM.VirtualNetworkGatewaySkuTier.VpnGw5AZ,
MNM.VirtualNetworkGatewaySkuTier.ErGw1AZ,
MNM.VirtualNetworkGatewaySkuTier.ErGw2AZ,
MNM.VirtualNetworkGatewaySkuTier.ErGw3AZ,
Expand Down Expand Up @@ -260,6 +264,15 @@ public class NewAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
[ValidateNotNullOrEmpty]
public string[] CustomRoute { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "The generation for this VirtualNetwork VPN gateway. Must be None if GatewayType is not VPN.")]
[PSArgumentCompleter(
MNM.VpnGatewayGeneration.None,
MNM.VpnGatewayGeneration.Generation1,
MNM.VpnGatewayGeneration.Generation2)]
public string VpnGatewayGeneration { get; set; }

[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
public SwitchParameter AsJob { get; set; }

Expand Down Expand Up @@ -462,6 +475,18 @@ private PSVirtualNetworkGateway CreateVirtualNetworkGateway()
vnetGateway.CustomRoutes = null;
}

vnetGateway.VpnGatewayGeneration = MNM.VpnGatewayGeneration.None;
if (this.VpnGatewayGeneration != null)
{
if (GatewayType.Equals(MNM.VirtualNetworkGatewayType.ExpressRoute.ToString(), StringComparison.InvariantCultureIgnoreCase) &&
!this.VpnGatewayGeneration.Equals(MNM.VpnGatewayGeneration.None, StringComparison.OrdinalIgnoreCase))
{
throw new ArgumentException("Virtual Network Express Route Gateway cannot have any generation other than None.");
}

vnetGateway.VpnGatewayGeneration = this.VpnGatewayGeneration;
}

// Map to the sdk object
var vnetGatewayModel = NetworkResourceManagerProfile.Mapper.Map<MNM.VirtualNetworkGateway>(vnetGateway);
vnetGatewayModel.Tags = TagsConversionHelper.CreateTagDictionary(this.Tag, validate: true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ public class SetAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
MNM.VirtualNetworkGatewaySkuTier.VpnGw1,
MNM.VirtualNetworkGatewaySkuTier.VpnGw2,
MNM.VirtualNetworkGatewaySkuTier.VpnGw3,
MNM.VirtualNetworkGatewaySkuTier.VpnGw4,
MNM.VirtualNetworkGatewaySkuTier.VpnGw5,
MNM.VirtualNetworkGatewaySkuTier.VpnGw1AZ,
MNM.VirtualNetworkGatewaySkuTier.VpnGw2AZ,
MNM.VirtualNetworkGatewaySkuTier.VpnGw3AZ,
MNM.VirtualNetworkGatewaySkuTier.VpnGw4AZ,
MNM.VirtualNetworkGatewaySkuTier.VpnGw5AZ,
MNM.VirtualNetworkGatewaySkuTier.ErGw1AZ,
MNM.VirtualNetworkGatewaySkuTier.ErGw2AZ,
MNM.VirtualNetworkGatewaySkuTier.ErGw3AZ,
Expand Down
51 changes: 44 additions & 7 deletions src/Network/Network/help/New-AzVirtualNetworkGateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ New-AzVirtualNetworkGateway -Name <String> -ResourceGroupName <String> -Location
[-GatewayDefaultSite <PSLocalNetworkGateway>] [-VpnClientAddressPool <String[]>]
[-VpnClientProtocol <String[]>] [-VpnClientRootCertificates <PSVpnClientRootCertificate[]>]
[-VpnClientRevokedCertificates <PSVpnClientRevokedCertificate[]>] [-VpnClientIpsecPolicy <PSIpsecPolicy[]>]
[-Asn <UInt32>] [-PeerWeight <Int32>] [-Tag <Hashtable>] [-Force] [-CustomRoute <String[]>] [-AsJob]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-Asn <UInt32>] [-PeerWeight <Int32>] [-Tag <Hashtable>] [-Force] [-CustomRoute <String[]>]
[-VpnGatewayGeneration <String>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

### RadiusServerConfiguration
Expand All @@ -34,7 +35,7 @@ New-AzVirtualNetworkGateway -Name <String> -ResourceGroupName <String> -Location
[-VpnClientProtocol <String[]>] [-VpnClientRootCertificates <PSVpnClientRootCertificate[]>]
[-VpnClientRevokedCertificates <PSVpnClientRevokedCertificate[]>] [-VpnClientIpsecPolicy <PSIpsecPolicy[]>]
[-Asn <UInt32>] [-PeerWeight <Int32>] [-Tag <Hashtable>] [-Force] -RadiusServerAddress <String>
-RadiusServerSecret <SecureString> [-CustomRoute <String[]>] [-AsJob]
-RadiusServerSecret <SecureString> [-CustomRoute <String[]>] [-VpnGatewayGeneration <String>] [-AsJob]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

Expand All @@ -46,9 +47,9 @@ New-AzVirtualNetworkGateway -Name <String> -ResourceGroupName <String> -Location
[-GatewayDefaultSite <PSLocalNetworkGateway>] [-VpnClientAddressPool <String[]>]
[-VpnClientProtocol <String[]>] [-VpnClientRootCertificates <PSVpnClientRootCertificate[]>]
[-VpnClientRevokedCertificates <PSVpnClientRevokedCertificate[]>] [-VpnClientIpsecPolicy <PSIpsecPolicy[]>]
[-Asn <UInt32>] [-PeerWeight <Int32>] [-Tag <Hashtable>] [-Force] -AadTenantUri <String> -AadAudienceId <String>
-AadIssuerUri <String> [-CustomRoute <String[]>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
[-Confirm] [<CommonParameters>]
[-Asn <UInt32>] [-PeerWeight <Int32>] [-Tag <Hashtable>] [-Force] -AadTenantUri <String>
-AadAudienceId <String> -AadIssuerUri <String> [-CustomRoute <String[]>] [-VpnGatewayGeneration <String>]
[-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -138,6 +139,25 @@ The above will create a resource group, request a Public IP Address, create a Vi
subnet and create a Virtual Network Gateway in Azure.
The gateway will be called "myNGW" within the resource group "vnet-gateway" in the location "UK West" with the previously created IP configurations saved in the variable "ngwIPConfig," the gateway type of "VPN," the vpn type "RouteBased," and the sku "Basic." It also configures AAD authentication configurations: AadTenantUri, AadIssuerUri and AadAudienceId for VpnClient of virtual network gateway.

### 5: Create a Virtual Network Gateway with VpnGatewayGeneration
```
New-AzResourceGroup -Location "UK West" -Name "vnet-gateway"
$subnet = New-AzVirtualNetworkSubnetConfig -Name 'gatewaysubnet' -AddressPrefix '10.254.0.0/27'

$ngwpip = New-AzPublicIpAddress -Name ngwpip -ResourceGroupName "vnet-gateway" -Location "UK West" -AllocationMethod Dynamic
$vnet = New-AzVirtualNetwork -AddressPrefix "10.254.0.0/27" -Location "UK West" -Name vnet-gateway -ResourceGroupName "vnet-gateway" -Subnet $subnet
$subnet = Get-AzVirtualNetworkSubnetConfig -name 'gatewaysubnet' -VirtualNetwork $vnet
$ngwipconfig = New-AzVirtualNetworkGatewayIpConfig -Name ngwipconfig -SubnetId $subnet.Id -PublicIpAddressId $ngwpip.Id

New-AzVirtualNetworkGateway -Name myNGW -ResourceGroupName vnet-gateway -Location "UK West" -IpConfigurations $ngwIpConfig -GatewayType "Vpn" -VpnType "RouteBased" -GatewaySku "VpnGw4" -VpnGatewayGeneration "Generation2"
```

The above will create a resource group, request a Public IP Address, create a Virtual Network and
subnet and create a Virtual Network Gateway in Azure.
The gateway will be called "myNGW" within the resource group "vnet-gateway" in the location "UK West"
with the previously created IP configurations saved in the variable "ngwIPConfig," the
gateway type of "VPN", the vpn type "RouteBased", the sku "VpnGw4" and VpnGatewayGeneration Generation2 enabled.

## PARAMETERS

### -AadAudienceId
Expand Down Expand Up @@ -308,7 +328,7 @@ Accept wildcard characters: False
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: Basic, Standard, HighPerformance, UltraPerformance, VpnGw1, VpnGw2, VpnGw3, VpnGw1AZ, VpnGw2AZ, VpnGw3AZ, ErGw1AZ, ErGw2AZ, ErGw3AZ
Accepted values: Basic, Standard, HighPerformance, UltraPerformance, VpnGw1, VpnGw2, VpnGw3, VpnGw4, VpnGw5, VpnGw1AZ, VpnGw2AZ, VpnGw3AZ, VpnGw4AZ, VpnGw5AZ, ErGw1AZ, ErGw2AZ, ErGw3AZ

Required: False
Position: Named
Expand Down Expand Up @@ -521,6 +541,23 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -VpnGatewayGeneration
The generation for this VirtualNetwork VPN gateway. Must be None if GatewayType is not VPN.
Once set, this property cannot be changed over the lifetime of the gateway.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: None, Generation1, Generation2

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -VpnType

```yaml
Expand Down
2 changes: 1 addition & 1 deletion src/Network/Network/help/Set-AzVirtualNetworkGateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ The acceptable values for this parameter are:
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: Basic, Standard, HighPerformance, UltraPerformance, VpnGw1, VpnGw2, VpnGw3, VpnGw1AZ, VpnGw2AZ, VpnGw3AZ, ErGw1AZ, ErGw2AZ, ErGw3AZ
Accepted values: Basic, Standard, HighPerformance, UltraPerformance, VpnGw1, VpnGw2, VpnGw3, VpnGw4, VpnGw5, VpnGw1AZ, VpnGw2AZ, VpnGw3AZ, VpnGw4AZ, VpnGw5AZ, ErGw1AZ, ErGw2AZ, ErGw3AZ

Required: False
Position: Named
Expand Down