Skip to content

Commit e93efb2

Browse files
committed
Merge branch 'network-september' into nrp-2019-08-01
# Conflicts: # src/Network/Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.VirtualNetworkGatewayTests/TestVirtualNetworkExpressRouteGatewayCRUD.json
2 parents d77cd2c + de7e9ea commit e93efb2

File tree

8 files changed

+2841
-2318
lines changed

8 files changed

+2841
-2318
lines changed

src/Network/Network.Test/ScenarioTests/VirtualNetworkGatewayTests.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ function Test-VirtualNetworkExpressRouteGatewayCRUD
2525
$vnetName = Get-ResourceName
2626
$publicIpName = Get-ResourceName
2727
$vnetGatewayConfigName = Get-ResourceName
28-
$rglocation = Get-ProviderLocation ResourceManagement "East US"
28+
$rglocation = Get-ProviderLocation ResourceManagement "West Central US"
2929
$resourceTypeParent = "Microsoft.Network/virtualNetworkGateways"
30-
$location = Get-ProviderLocation $resourceTypeParent "East US"
30+
$location = Get-ProviderLocation $resourceTypeParent "West Central US"
3131

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

50-
$actual = New-AzVirtualNetworkGateway -ResourceGroupName $rgname -name $rname -location $location -IpConfigurations $vnetIpConfig -GatewayType ExpressRoute -GatewaySku UltraPerformance -VpnType RouteBased -Force
50+
$actual = New-AzVirtualNetworkGateway -ResourceGroupName $rgname -name $rname -location $location -IpConfigurations $vnetIpConfig -GatewayType ExpressRoute -GatewaySku UltraPerformance -VpnType RouteBased -VpnGatewayGeneration None -Force
5151
$expected = Get-AzVirtualNetworkGateway -ResourceGroupName $rgname -name $rname
5252
Assert-AreEqual $expected.ResourceGroupName $actual.ResourceGroupName
5353
Assert-AreEqual $expected.Name $actual.Name
5454
Assert-AreEqual "ExpressRoute" $expected.GatewayType
55+
Assert-AreEqual "None" $expected.VpnGatewayGeneration
5556

5657
# List virtualNetworkGateways
5758
$list = Get-AzVirtualNetworkGateway -ResourceGroupName $rgname

src/Network/Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.VirtualNetworkGatewayTests/TestVirtualNetworkExpressRouteGatewayCRUD.json

Lines changed: 2758 additions & 2307 deletions
Large diffs are not rendered by default.

src/Network/Network/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
- New-VpnConnection
4242
- Update-VpnConnection
4343
* Fixed documents for some PowerShell examples to use Az cmdlets instead of AzureRM cmdlets
44+
* New Generations and SKUs for VirtualNetworkGateways
45+
- Introduce new Generations for VirtualNetworkGateways.
46+
- Introduce new high throughput SKUs for VirtualNetworkGateways.
4447

4548
## Version 1.13.0
4649
* Updated New-AzPrivateLinkServiceIpConfig

src/Network/Network/Models/PSVirtualNetworkGateway.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ public class PSVirtualNetworkGateway : PSTopLevelResource
4747

4848
public PSAddressSpace CustomRoutes { get; set; }
4949

50+
public string VpnGatewayGeneration { get; set; }
51+
5052
[JsonIgnore]
5153
public string IpConfigurationsText
5254
{

src/Network/Network/VirtualNetworkGateway/NewAzureVirtualNetworkGatewayCommand.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,13 @@ public class NewAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
139139
MNM.VirtualNetworkGatewaySkuTier.VpnGw1,
140140
MNM.VirtualNetworkGatewaySkuTier.VpnGw2,
141141
MNM.VirtualNetworkGatewaySkuTier.VpnGw3,
142+
MNM.VirtualNetworkGatewaySkuTier.VpnGw4,
143+
MNM.VirtualNetworkGatewaySkuTier.VpnGw5,
142144
MNM.VirtualNetworkGatewaySkuTier.VpnGw1AZ,
143145
MNM.VirtualNetworkGatewaySkuTier.VpnGw2AZ,
144146
MNM.VirtualNetworkGatewaySkuTier.VpnGw3AZ,
147+
MNM.VirtualNetworkGatewaySkuTier.VpnGw4AZ,
148+
MNM.VirtualNetworkGatewaySkuTier.VpnGw5AZ,
145149
MNM.VirtualNetworkGatewaySkuTier.ErGw1AZ,
146150
MNM.VirtualNetworkGatewaySkuTier.ErGw2AZ,
147151
MNM.VirtualNetworkGatewaySkuTier.ErGw3AZ,
@@ -260,6 +264,15 @@ public class NewAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
260264
[ValidateNotNullOrEmpty]
261265
public string[] CustomRoute { get; set; }
262266

267+
[Parameter(
268+
Mandatory = false,
269+
HelpMessage = "The generation for this VirtualNetwork VPN gateway. Must be None if GatewayType is not VPN.")]
270+
[PSArgumentCompleter(
271+
MNM.VpnGatewayGeneration.None,
272+
MNM.VpnGatewayGeneration.Generation1,
273+
MNM.VpnGatewayGeneration.Generation2)]
274+
public string VpnGatewayGeneration { get; set; }
275+
263276
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
264277
public SwitchParameter AsJob { get; set; }
265278

@@ -462,6 +475,18 @@ private PSVirtualNetworkGateway CreateVirtualNetworkGateway()
462475
vnetGateway.CustomRoutes = null;
463476
}
464477

478+
vnetGateway.VpnGatewayGeneration = MNM.VpnGatewayGeneration.None;
479+
if (this.VpnGatewayGeneration != null)
480+
{
481+
if (GatewayType.Equals(MNM.VirtualNetworkGatewayType.ExpressRoute.ToString(), StringComparison.InvariantCultureIgnoreCase) &&
482+
!this.VpnGatewayGeneration.Equals(MNM.VpnGatewayGeneration.None, StringComparison.OrdinalIgnoreCase))
483+
{
484+
throw new ArgumentException("Virtual Network Express Route Gateway cannot have any generation other than None.");
485+
}
486+
487+
vnetGateway.VpnGatewayGeneration = this.VpnGatewayGeneration;
488+
}
489+
465490
// Map to the sdk object
466491
var vnetGatewayModel = NetworkResourceManagerProfile.Mapper.Map<MNM.VirtualNetworkGateway>(vnetGateway);
467492
vnetGatewayModel.Tags = TagsConversionHelper.CreateTagDictionary(this.Tag, validate: true);

src/Network/Network/VirtualNetworkGateway/UpdateAzureVirtualNetworkGatewayCommand.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@ public class SetAzureVirtualNetworkGatewayCommand : VirtualNetworkGatewayBaseCmd
4949
MNM.VirtualNetworkGatewaySkuTier.VpnGw1,
5050
MNM.VirtualNetworkGatewaySkuTier.VpnGw2,
5151
MNM.VirtualNetworkGatewaySkuTier.VpnGw3,
52+
MNM.VirtualNetworkGatewaySkuTier.VpnGw4,
53+
MNM.VirtualNetworkGatewaySkuTier.VpnGw5,
5254
MNM.VirtualNetworkGatewaySkuTier.VpnGw1AZ,
5355
MNM.VirtualNetworkGatewaySkuTier.VpnGw2AZ,
5456
MNM.VirtualNetworkGatewaySkuTier.VpnGw3AZ,
57+
MNM.VirtualNetworkGatewaySkuTier.VpnGw4AZ,
58+
MNM.VirtualNetworkGatewaySkuTier.VpnGw5AZ,
5559
MNM.VirtualNetworkGatewaySkuTier.ErGw1AZ,
5660
MNM.VirtualNetworkGatewaySkuTier.ErGw2AZ,
5761
MNM.VirtualNetworkGatewaySkuTier.ErGw3AZ,

src/Network/Network/help/New-AzVirtualNetworkGateway.md

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ New-AzVirtualNetworkGateway -Name <String> -ResourceGroupName <String> -Location
2121
[-GatewayDefaultSite <PSLocalNetworkGateway>] [-VpnClientAddressPool <String[]>]
2222
[-VpnClientProtocol <String[]>] [-VpnClientRootCertificates <PSVpnClientRootCertificate[]>]
2323
[-VpnClientRevokedCertificates <PSVpnClientRevokedCertificate[]>] [-VpnClientIpsecPolicy <PSIpsecPolicy[]>]
24-
[-Asn <UInt32>] [-PeerWeight <Int32>] [-Tag <Hashtable>] [-Force] [-CustomRoute <String[]>] [-AsJob]
25-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
24+
[-Asn <UInt32>] [-PeerWeight <Int32>] [-Tag <Hashtable>] [-Force] [-CustomRoute <String[]>]
25+
[-VpnGatewayGeneration <String>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
26+
[<CommonParameters>]
2627
```
2728

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

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

5455
## DESCRIPTION
@@ -138,6 +139,25 @@ The above will create a resource group, request a Public IP Address, create a Vi
138139
subnet and create a Virtual Network Gateway in Azure.
139140
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.
140141

142+
### 5: Create a Virtual Network Gateway with VpnGatewayGeneration
143+
```
144+
New-AzResourceGroup -Location "UK West" -Name "vnet-gateway"
145+
$subnet = New-AzVirtualNetworkSubnetConfig -Name 'gatewaysubnet' -AddressPrefix '10.254.0.0/27'
146+
147+
$ngwpip = New-AzPublicIpAddress -Name ngwpip -ResourceGroupName "vnet-gateway" -Location "UK West" -AllocationMethod Dynamic
148+
$vnet = New-AzVirtualNetwork -AddressPrefix "10.254.0.0/27" -Location "UK West" -Name vnet-gateway -ResourceGroupName "vnet-gateway" -Subnet $subnet
149+
$subnet = Get-AzVirtualNetworkSubnetConfig -name 'gatewaysubnet' -VirtualNetwork $vnet
150+
$ngwipconfig = New-AzVirtualNetworkGatewayIpConfig -Name ngwipconfig -SubnetId $subnet.Id -PublicIpAddressId $ngwpip.Id
151+
152+
New-AzVirtualNetworkGateway -Name myNGW -ResourceGroupName vnet-gateway -Location "UK West" -IpConfigurations $ngwIpConfig -GatewayType "Vpn" -VpnType "RouteBased" -GatewaySku "VpnGw4" -VpnGatewayGeneration "Generation2"
153+
```
154+
155+
The above will create a resource group, request a Public IP Address, create a Virtual Network and
156+
subnet and create a Virtual Network Gateway in Azure.
157+
The gateway will be called "myNGW" within the resource group "vnet-gateway" in the location "UK West"
158+
with the previously created IP configurations saved in the variable "ngwIPConfig," the
159+
gateway type of "VPN", the vpn type "RouteBased", the sku "VpnGw4" and VpnGatewayGeneration Generation2 enabled.
160+
141161
## PARAMETERS
142162

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

313333
Required: False
314334
Position: Named
@@ -521,6 +541,23 @@ Accept pipeline input: True (ByPropertyName)
521541
Accept wildcard characters: False
522542
```
523543
544+
### -VpnGatewayGeneration
545+
The generation for this VirtualNetwork VPN gateway. Must be None if GatewayType is not VPN.
546+
Once set, this property cannot be changed over the lifetime of the gateway.
547+
548+
```yaml
549+
Type: System.String
550+
Parameter Sets: (All)
551+
Aliases:
552+
Accepted values: None, Generation1, Generation2
553+
554+
Required: False
555+
Position: Named
556+
Default value: None
557+
Accept pipeline input: False
558+
Accept wildcard characters: False
559+
```
560+
524561
### -VpnType
525562
526563
```yaml

src/Network/Network/help/Set-AzVirtualNetworkGateway.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ The acceptable values for this parameter are:
398398
Type: System.String
399399
Parameter Sets: (All)
400400
Aliases:
401-
Accepted values: Basic, Standard, HighPerformance, UltraPerformance, VpnGw1, VpnGw2, VpnGw3, VpnGw1AZ, VpnGw2AZ, VpnGw3AZ, ErGw1AZ, ErGw2AZ, ErGw3AZ
401+
Accepted values: Basic, Standard, HighPerformance, UltraPerformance, VpnGw1, VpnGw2, VpnGw3, VpnGw4, VpnGw5, VpnGw1AZ, VpnGw2AZ, VpnGw3AZ, VpnGw4AZ, VpnGw5AZ, ErGw1AZ, ErGw2AZ, ErGw3AZ
402402

403403
Required: False
404404
Position: Named

0 commit comments

Comments
 (0)