Skip to content

Commit 7bff831

Browse files
authored
New-AzVirtualNetworkGatewayConnection: Addition EnablePrivateLinkFastPath property/parameter (#19419)
1 parent 85abb6e commit 7bff831

File tree

5 files changed

+33
-4
lines changed

5 files changed

+33
-4
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ function Test-VirtualNetworkeExpressRouteGatewayConnectionCRUD
4545
Assert-AreEqual "ExpressRoute" $expected.ConnectionType
4646
Assert-AreEqual "3" $expected.RoutingWeight
4747
Assert-AreEqual $False $expected.ExpressRouteGatewayBypass
48+
Assert-AreEqual $False $expected.EnablePrivateLinkFastPath
4849

4950
$list = Get-AzVirtualNetworkGatewayConnection -ResourceGroupName $rgname -Name "*"
5051
Assert-True { $list.Count -ge 0 }
@@ -58,14 +59,15 @@ function Test-VirtualNetworkeExpressRouteGatewayConnectionCRUD
5859
$list = Get-AzVirtualNetworkGatewayConnection -ResourceGroupName $actual.ResourceGroupName
5960
Assert-AreEqual 0 @($list).Count
6061

61-
# Now Create a Virtual Network Gateway Connection with ExpressRouteGatewayBypass enabled
62-
$connection = New-AzVirtualNetworkGatewayConnection -ResourceGroupName $rgname -name $vnetConnectionName -location $location -VirtualNetworkGateway1 $gw -ConnectionType ExpressRoute -RoutingWeight 3 -PeerId $circuit.Id -ExpressRouteGatewayBypass
62+
# Now Create a Virtual Network Gateway Connection with ExpressRouteGatewayBypass and EnablePrivateLinkFastPath
63+
$connection = New-AzVirtualNetworkGatewayConnection -ResourceGroupName $rgname -name $vnetConnectionName -location $location -VirtualNetworkGateway1 $gw -ConnectionType ExpressRoute -RoutingWeight 3 -PeerId $circuit.Id -ExpressRouteGatewayBypass -EnablePrivateLinkFastPath
6364
$getConnection = Get-AzVirtualNetworkGatewayConnection -ResourceGroupName $rgname -name $vnetConnectionName
6465
Assert-AreEqual $getConnection.ResourceGroupName $connection.ResourceGroupName
6566
Assert-AreEqual $getConnection.Name $connection.Name
6667
Assert-AreEqual "ExpressRoute" $getConnection.ConnectionType
6768
Assert-AreEqual "3" $getConnection.RoutingWeight
6869
Assert-AreEqual $True $getConnection.ExpressRouteGatewayBypass
70+
Assert-AreEqual $True $getConnection.EnablePrivateLinkFastPath
6971

7072
# Delete VirtualNetworkGatewayConnection
7173
$delete = Remove-AzVirtualNetworkGatewayConnection -ResourceGroupName $actual.ResourceGroupName -name $vnetConnectionName -PassThru -Force

src/Network/Network/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
--->
2020

2121
## Upcoming Release
22+
* Updated commandlet to support bypassing the ExpressRoute gateway when accessing private-links.
23+
- `New-AzVirtualNetworkGatewayConnection`
2224

2325
## Version 4.20.1
2426
* Added breaking change notification for `Get-AzFirewall`, `New-AzFirewall`, `Set-AzFirewall` and `New-AzFirewallHubIpAddress`

src/Network/Network/Models/PSVirtualNetworkGatewayConnection.cs

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

7373
public bool ExpressRouteGatewayBypass { get; set; }
7474

75+
public bool EnablePrivateLinkFastPath { get; set; }
76+
7577
[Ps1Xml(Target = ViewControl.Table)]
7678
public string ConnectionProtocol { get; set; }
7779

src/Network/Network/VirtualNetworkGatewayConnection/NewAzureVirtualNetworkGatewayConnectionCommand.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ public class NewAzureVirtualNetworkGatewayConnectionCommand : VirtualNetworkGate
196196
HelpMessage = "Whether to use accelerated virtual network access by bypassing gateway")]
197197
public SwitchParameter ExpressRouteGatewayBypass { get; set; }
198198

199+
[Parameter(
200+
Mandatory = false,
201+
ValueFromPipelineByPropertyName = true,
202+
HelpMessage = "Bypass the ExpressRoute gateway when accessing private-links. " +
203+
"ExpressRoute FastPath (ExpressRouteGatewayBypass) must be enabled.")]
204+
public SwitchParameter EnablePrivateLinkFastPath { get; set; }
205+
199206
public override void Execute()
200207
{
201208
base.Execute();
@@ -231,6 +238,7 @@ private PSVirtualNetworkGatewayConnection CreateVirtualNetworkGatewayConnection(
231238
vnetGatewayConnection.UseLocalAzureIpAddress = this.UseLocalAzureIpAddress.IsPresent;
232239
vnetGatewayConnection.UsePolicyBasedTrafficSelectors = this.UsePolicyBasedTrafficSelectors;
233240
vnetGatewayConnection.ExpressRouteGatewayBypass = this.ExpressRouteGatewayBypass.IsPresent;
241+
vnetGatewayConnection.EnablePrivateLinkFastPath = this.EnablePrivateLinkFastPath.IsPresent;
234242

235243
if (!string.IsNullOrWhiteSpace(this.ConnectionProtocol))
236244
{

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ New-AzVirtualNetworkGatewayConnection -Name <String> -ResourceGroupName <String>
2323
[-Force] [-UsePolicyBasedTrafficSelectors <Boolean>] [-IpsecPolicies <PSIpsecPolicy[]>]
2424
[-TrafficSelectorPolicy <PSTrafficSelectorPolicy[]>] [-ConnectionProtocol <String>]
2525
[-IngressNatRule <PSResourceId[]>] [-EgressNatRule <PSResourceId[]>] [-AsJob] [-ExpressRouteGatewayBypass]
26-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
26+
[-EnablePrivateLinkFastPath] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
2727
```
2828

2929
### SetByResourceId
@@ -36,7 +36,7 @@ New-AzVirtualNetworkGatewayConnection -Name <String> -ResourceGroupName <String>
3636
[-Force] [-UsePolicyBasedTrafficSelectors <Boolean>] [-IpsecPolicies <PSIpsecPolicy[]>]
3737
[-TrafficSelectorPolicy <PSTrafficSelectorPolicy[]>] [-ConnectionProtocol <String>]
3838
[-IngressNatRule <PSResourceId[]>] [-EgressNatRule <PSResourceId[]>] [-AsJob] [-ExpressRouteGatewayBypass]
39-
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
39+
[-EnablePrivateLinkFastPath] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
4040
```
4141

4242
## DESCRIPTION
@@ -228,6 +228,21 @@ Accept pipeline input: True (ByPropertyName)
228228
Accept wildcard characters: False
229229
```
230230
231+
### -EnablePrivateLinkFastPath
232+
Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (ExpressRouteGatewayBypass) must be enabled.
233+
234+
```yaml
235+
Type: System.Management.Automation.SwitchParameter
236+
Parameter Sets: (All)
237+
Aliases:
238+
239+
Required: False
240+
Position: Named
241+
Default value: None
242+
Accept pipeline input: True (ByPropertyName)
243+
Accept wildcard characters: False
244+
```
245+
231246
### -Force
232247
Do not ask for confirmation if you want to overwrite a resource
233248

0 commit comments

Comments
 (0)