Skip to content

Commit 2b3990e

Browse files
author
Maddie Clayton
authored
Merge pull request #7027 from pashukl/preview
Changes to Support Accelerated Virtual Network Datapath for ExpressRoute
2 parents 897abf8 + 583ab32 commit 2b3990e

File tree

7 files changed

+48
-3
lines changed

7 files changed

+48
-3
lines changed

src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/VirtualNetworkGatewayConnectionTests.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function Test-VirtualNetworkeExpressRouteGatewayConnectionCRUD
4343
Assert-AreEqual $expected.Name $actual.Name
4444
Assert-AreEqual "ExpressRoute" $expected.ConnectionType
4545
Assert-AreEqual "3" $expected.RoutingWeight
46+
Assert-AreEqual $False $expected.ExpressRouteGatewayBypass
4647

4748
#get routes
4849
Get-AzureRmExpressRouteCircuitARPTable -ResourceGroupName $rgname -ExpressRouteCircuitName $circuit.Name -PeeringType AzurePrivatePeering -DevicePath Primary
@@ -52,6 +53,21 @@ function Test-VirtualNetworkeExpressRouteGatewayConnectionCRUD
5253
Assert-AreEqual true $delete
5354
$list = Get-AzureRmVirtualNetworkGatewayConnection -ResourceGroupName $actual.ResourceGroupName
5455
Assert-AreEqual 0 @($list).Count
56+
57+
# Now Create a Virtual Network Gateway Connection with ExpressRouteGatewayBypass enabled
58+
$connection = New-AzureRmVirtualNetworkGatewayConnection -ResourceGroupName $rgname -name $vnetConnectionName -location $location -VirtualNetworkGateway1 $gw -ConnectionType ExpressRoute -RoutingWeight 3 -PeerId $circuit.Id -ExpressRouteGatewayBypass
59+
$getConnection = Get-AzureRmVirtualNetworkGatewayConnection -ResourceGroupName $rgname -name $vnetConnectionName
60+
Assert-AreEqual $getConnection.ResourceGroupName $connection.ResourceGroupName
61+
Assert-AreEqual $getConnection.Name $connection.Name
62+
Assert-AreEqual "ExpressRoute" $getConnection.ConnectionType
63+
Assert-AreEqual "3" $getConnection.RoutingWeight
64+
Assert-AreEqual $True $getConnection.ExpressRouteGatewayBypass
65+
66+
# Delete VirtualNetworkGatewayConnection
67+
$delete = Remove-AzureRmVirtualNetworkGatewayConnection -ResourceGroupName $actual.ResourceGroupName -name $vnetConnectionName -PassThru -Force
68+
Assert-AreEqual true $delete
69+
$list = Get-AzureRmVirtualNetworkGatewayConnection -ResourceGroupName $actual.ResourceGroupName
70+
Assert-AreEqual 0 @($list).Count
5571
}
5672
finally
5773
{

src/ResourceManager/Network/Commands.Network/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
## Current Release
2222
* Fixed issue with default resource groups not being set.
23+
* Updated cmdlet New-AzureRmVirtualNetworkGatewayConnection with support for switch ExpressRouteGatewayBypass
2324

2425
## Version 6.5.0
2526
* Added example for Set-AzureRmLocalNetworkGateway

src/ResourceManager/Network/Commands.Network/Models/PSVirtualNetworkGatewayConnection.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ public class PSVirtualNetworkGatewayConnection : PSTopLevelResource
5959

6060
public List<PSIpsecPolicy> IpsecPolicies { get; set; }
6161

62+
public bool ExpressRouteGatewayBypass { get; set; }
63+
6264
[JsonIgnore]
6365
public string VirtualNetworkGateway1Text
6466
{

src/ResourceManager/Network/Commands.Network/VirtualNetworkGatewayConnection/NewAzureVirtualNetworkGatewayConnectionCommand.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ public class NewAzureVirtualNetworkGatewayConnectionCommand : VirtualNetworkGate
146146
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
147147
public SwitchParameter AsJob { get; set; }
148148

149+
[Parameter(
150+
Mandatory = false,
151+
ValueFromPipelineByPropertyName = true,
152+
HelpMessage = "Whether to use accelerated virtual network access by bypassing gateway")]
153+
public SwitchParameter ExpressRouteGatewayBypass { get; set; }
154+
149155
public override void Execute()
150156
{
151157
base.Execute();
@@ -177,6 +183,7 @@ private PSVirtualNetworkGatewayConnection CreateVirtualNetworkGatewayConnection(
177183
vnetGatewayConnection.SharedKey = this.SharedKey;
178184
vnetGatewayConnection.EnableBgp = this.EnableBgp;
179185
vnetGatewayConnection.UsePolicyBasedTrafficSelectors = this.UsePolicyBasedTrafficSelectors;
186+
vnetGatewayConnection.ExpressRouteGatewayBypass = this.ExpressRouteGatewayBypass.IsPresent;
180187

181188
if (!string.IsNullOrEmpty(this.AuthorizationKey))
182189
{

src/ResourceManager/Network/Commands.Network/help/New-AzureRmVirtualNetworkGatewayConnection.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ New-AzureRmVirtualNetworkGatewayConnection -Name <String> -ResourceGroupName <St
2020
[-VirtualNetworkGateway2 <PSVirtualNetworkGateway>] [-LocalNetworkGateway2 <PSLocalNetworkGateway>]
2121
-ConnectionType <String> [-RoutingWeight <Int32>] [-SharedKey <String>] [-Peer <PSPeering>]
2222
[-EnableBgp <Boolean>] [-Tag <Hashtable>] [-Force] [-UsePolicyBasedTrafficSelectors <Boolean>]
23-
[-IpsecPolicies <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSIpsecPolicy]>]
23+
[-IpsecPolicies <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSIpsecPolicy]>] [-ExpressRouteGatewayBypass]
2424
[-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
2525
```
2626

@@ -31,7 +31,7 @@ New-AzureRmVirtualNetworkGatewayConnection -Name <String> -ResourceGroupName <St
3131
[-VirtualNetworkGateway2 <PSVirtualNetworkGateway>] [-LocalNetworkGateway2 <PSLocalNetworkGateway>]
3232
-ConnectionType <String> [-RoutingWeight <Int32>] [-SharedKey <String>] [-PeerId <String>]
3333
[-EnableBgp <Boolean>] [-Tag <Hashtable>] [-Force] [-UsePolicyBasedTrafficSelectors <Boolean>]
34-
[-IpsecPolicies <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSIpsecPolicy]>]
34+
[-IpsecPolicies <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSIpsecPolicy]>] [-ExpressRouteGatewayBypass]
3535
[-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
3636
```
3737

@@ -120,6 +120,20 @@ Accept pipeline input: True (ByPropertyName)
120120
Accept wildcard characters: False
121121
```
122122
123+
### -ExpressRouteGatewayBypass
124+
125+
```yaml
126+
Type: System.Management.Automation.SwitchParameter
127+
Parameter Sets: (All)
128+
Aliases:
129+
130+
Required: False
131+
Position: Named
132+
Default value: None
133+
Accept pipeline input: True (ByPropertyName)
134+
Accept wildcard characters: False
135+
```
136+
123137
### -Force
124138
125139
```yaml

src/StackAdmin/Network/Commands.Network/Microsoft.Azure.Commands.Network.format.ps1xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,11 @@
245245
<ListItem>
246246
<Label>TunnelConnectionStatus</Label>
247247
<PropertyName>TunnelConnectionStatusText</PropertyName>
248-
</ListItem>
248+
</ListItem>
249+
<ListItem>
250+
<Label>ExpressRouteGatewayBypass</Label>
251+
<PropertyName>ExpressRouteGatewayBypass</PropertyName>
252+
</ListItem>
249253
</ListItems>
250254
</ListEntry>
251255
</ListEntries>

tools/StaticAnalysis/Exceptions/AzureRM.Network/SignatureIssues.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
"C:\azure-powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Network\Microsoft.Azure.Commands.Network.dll","Microsoft.Azure.Commands.Network.SetAzureLocalNetworkGatewayCommand","Set-AzureRmLocalNetworkGateway","1","8100","Set-AzureRmLocalNetworkGateway Does not support ShouldProcess but the cmdlet verb Set indicates that it should.","Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue"
194194
"C:\azure-powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Network\Microsoft.Azure.Commands.Network.dll","Microsoft.Azure.Commands.Network.NewAzureVirtualNetworkGatewayConnectionCommand","New-AzureRmVirtualNetworkGatewayConnection","1","8410","Parameter UsePolicyBasedTrafficSelectors of cmdlet New-AzureRmVirtualNetworkGatewayConnection does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name."
195195
"C:\azure-powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Network\Microsoft.Azure.Commands.Network.dll","Microsoft.Azure.Commands.Network.NewAzureVirtualNetworkGatewayConnectionCommand","New-AzureRmVirtualNetworkGatewayConnection","1","8410","Parameter IpsecPolicies of cmdlet New-AzureRmVirtualNetworkGatewayConnection does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name."
196+
"C:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Network\Microsoft.Azure.Commands.Network.dll","Microsoft.Azure.Commands.Network.NewAzureVirtualNetworkGatewayConnectionCommand","New-AzureRmVirtualNetworkGatewayConnection","1","8410","Parameter ExpressRouteGatewayBypass of cmdlet New-AzureRmVirtualNetworkGatewayConnection does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name."
196197
"C:\azure-powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Network\Microsoft.Azure.Commands.Network.dll","Microsoft.Azure.Commands.Network.RemoveAzureVirtualNetworkGatewayConnectionCommand","Remove-AzureRmVirtualNetworkGatewayConnection","1","8600","Cmdlet 'Remove-AzureRmVirtualNetworkGatewayConnection' has no defined output type.","Add an OutputType attribute that declares the type of the object(s) returned by this cmdlet. If this cmdlet returns no output, please set the output type to 'bool' and make sure to implement the 'PassThru' parameter."
197198
"C:\azure-powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Network\Microsoft.Azure.Commands.Network.dll","Microsoft.Azure.Commands.Network.SetAzureVirtualNetworkGatewayConnectionCommand","Set-AzureRmVirtualNetworkGatewayConnection","1","8410","Parameter UsePolicyBasedTrafficSelectors of cmdlet Set-AzureRmVirtualNetworkGatewayConnection does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name."
198199
"C:\azure-powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Network\Microsoft.Azure.Commands.Network.dll","Microsoft.Azure.Commands.Network.SetAzureVirtualNetworkGatewayConnectionCommand","Set-AzureRmVirtualNetworkGatewayConnection","1","8410","Parameter IpsecPolicies of cmdlet Set-AzureRmVirtualNetworkGatewayConnection does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name."

0 commit comments

Comments
 (0)