Skip to content
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

Adding ExpressRouteGatewayBypass parameter to New-AzExpressRouteConnection and Set-AzExpressRouteConnection cmdlet #13375

Closed
wants to merge 8 commits into from
Closed
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
3 changes: 3 additions & 0 deletions src/Network/Network/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
- Added parameter -SkuTier
- Added parameter -SkuName and made Sku as Alias for this
- Removed parameter -Sku
* Updated ExpressRouteConnection:
- Added parameter `-ExpressRouteGatewayBypass` in `New-AzExpressRouteConnection`
- Added parameter `-ExpressRouteGatewayBypass` in `Set-AzExpressRouteConnection`

## Version 3.5.0
* Added Office365 Policy to VPNSite Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ public class NewAzureRmExpressRouteConnectionCommand : ExpressRouteConnectionBas
HelpMessage = "Enable internet security for this ExpressRoute Gateway connection")]
public SwitchParameter EnableInternetSecurity { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "Bypass ExpressRoute Gateway for this ExpressRoute Gateway connection")]
public SwitchParameter ExpressRouteGatewayBypass { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "The routing configuration for this ExpressRoute Gateway connection")]
Expand Down Expand Up @@ -150,7 +155,8 @@ private PSExpressRouteConnection CreateExpressRouteConnection()
{
Name = this.Name,
ExpressRouteCircuitPeering = peeringResourceId,
EnableInternetSecurity = this.EnableInternetSecurity.IsPresent
EnableInternetSecurity = this.EnableInternetSecurity.IsPresent,
ExpressRouteGatewayBypass = this.ExpressRouteGatewayBypass.IsPresent
};

if (this.RoutingConfiguration != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ public class UpdateAzureRmExpressRouteConnectionCommand : ExpressRouteConnection
HelpMessage = "Enable internet security for this connection")]
public bool? EnableInternetSecurity { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "Bypass ExpressRoute Gateway for this connection")]
public bool? ExpressRouteGatewayBypass { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "The routing configuration for this ExpressRoute Gateway connection")]
Expand Down Expand Up @@ -155,6 +160,11 @@ public override void Execute()
expressRouteConnectionToModify.EnableInternetSecurity = this.EnableInternetSecurity.Value;
}

if (this.ExpressRouteGatewayBypass.HasValue)
{
expressRouteConnectionToModify.ExpressRouteGatewayBypass = this.ExpressRouteGatewayBypass.Value;
}

if (this.RoutingConfiguration != null)
{
if (this.RoutingConfiguration.VnetRoutes != null && this.RoutingConfiguration.VnetRoutes.StaticRoutes != null && this.RoutingConfiguration.VnetRoutes.StaticRoutes.Any())
Expand Down
3 changes: 3 additions & 0 deletions src/Network/Network/Models/Cortex/PSExpressRouteConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public class PSExpressRouteConnection : PSChildResource
[Ps1Xml(Label = "Internet Security Enabled", Target = ViewControl.Table)]
public bool EnableInternetSecurity { get; set; }

[Ps1Xml(Label = "ExpressRoute GatewayBypass Enabled", Target = ViewControl.Table)]
public bool ExpressRouteGatewayBypass { get; set; }

public PSRoutingConfiguration RoutingConfiguration { get; set; }

[Ps1Xml(Label = "Provisioning State", Target = ViewControl.Table)]
Expand Down
4 changes: 4 additions & 0 deletions src/Network/Network/Network.format.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -4853,6 +4853,10 @@
<Label>EnableInternetSecurity</Label>
<PropertyName>EnableInternetSecurity</PropertyName>
</ListItem>
<ListItem>
<Label>ExpressRouteGatewayBypass</Label>
<PropertyName>ExpressRouteGatewayBypass</PropertyName>
</ListItem>
<ListItem>
<Label>ProvisioningState</Label>
<PropertyName>ProvisioningState</PropertyName>
Expand Down
5 changes: 4 additions & 1 deletion src/Network/Network/help/Get-AzExpressRouteConnection.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Name : testConnection
Etag : W/"00000000-0000-0000-0000-000000000000"
Id : /subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/ExpressRouteGateways/testExpressRoutegw/expressRouteConnections/testConnection
EnableInternetSecurity : False
ExpressRouteGatewayBypass : False
RoutingConfiguration : {
"AssociatedRouteTable": {
"Id": "/subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/virtualHubs/westushub/hubRouteTables/defaultRouteTable"
Expand Down Expand Up @@ -96,6 +97,7 @@ Name : testConnection1
Etag : W/"00000000-0000-0000-0000-000000000000"
Id : /subscriptions/{subscriptionId}/resourceGroups/ps9361/providers/Microsoft.Network/ExpressRouteGateways/testExpressRoutegw/expressRouteConnections/testConnection1
EnableInternetSecurity : False
ExpressRouteGatewayBypass : False
RoutingConfiguration : {
"AssociatedRouteTable": {
"Id": "/subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/virtualHubs/westushub/hubRouteTables/defaultRouteTable"
Expand All @@ -121,6 +123,7 @@ Name : testConnection2
Etag : W/"00000000-0000-0000-0000-000000000000"
Id : /subscriptions/{subscriptionId}/resourceGroups/ps9361/providers/Microsoft.Network/ExpressRouteGateways/testExpressRoutegw/expressRouteConnections/testConnection2
EnableInternetSecurity : False
ExpressRouteGatewayBypass : False
RoutingConfiguration : {
"AssociatedRouteTable": {
"Id": "/subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/virtualHubs/westushub/hubRouteTables/defaultRouteTable"
Expand Down Expand Up @@ -246,4 +249,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## NOTES

## RELATED LINKS
## RELATED LINKS
25 changes: 22 additions & 3 deletions src/Network/Network/help/New-AzExpressRouteConnection.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,24 @@ Creates an ExpressRoute connection that connects an ExpressRoute gateway to an o
```
New-AzExpressRouteConnection -ResourceGroupName <String> -ExpressRouteGatewayName <String> -Name <String>
-ExpressRouteCircuitPeeringId <String> [-AuthorizationKey <String>] [-RoutingWeight <UInt32>]
[-EnableInternetSecurity] [-RoutingConfiguration <PSRoutingConfiguration>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-EnableInternetSecurity] [-ExpressRouteGatewayBypass] [-RoutingConfiguration <PSRoutingConfiguration>]
[-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### ByExpressRouteGatewayObject
```
New-AzExpressRouteConnection -ExpressRouteGatewayObject <PSExpressRouteGateway> -Name <String>
-ExpressRouteCircuitPeeringId <String> [-AuthorizationKey <String>] [-RoutingWeight <UInt32>]
[-EnableInternetSecurity] [-RoutingConfiguration <PSRoutingConfiguration>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-EnableInternetSecurity] [-ExpressRouteGatewayBypass] [-RoutingConfiguration <PSRoutingConfiguration>]
[-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### ByExpressRouteGatewayResourceId
```
New-AzExpressRouteConnection -ParentResourceId <String> -Name <String> -ExpressRouteCircuitPeeringId <String>
[-AuthorizationKey <String>] [-RoutingWeight <UInt32>] [-EnableInternetSecurity] [-RoutingConfiguration <PSRoutingConfiguration>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-AuthorizationKey <String>] [-RoutingWeight <UInt32>] [-EnableInternetSecurity] [-ExpressRouteGatewayBypass]
[-RoutingConfiguration <PSRoutingConfiguration>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf]
[-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -155,6 +159,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -ExpressRouteGatewayBypass
Bypass ExpressRoute Gateway for this ExpressRoute Gateway connection

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

### -ExpressRouteGatewayName
The resource group name.

Expand Down
23 changes: 19 additions & 4 deletions src/Network/Network/help/Set-AzExpressRouteConnection.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ Updates an express route connection created between an express route gateway and
### ByExpressRouteConnectionName (Default)
```
Set-AzExpressRouteConnection -ResourceGroupName <String> -ExpressRouteGatewayName <String> -Name <String>
[-AuthorizationKey <String>] [-RoutingWeight <UInt32>] [-EnableInternetSecurity] [-RoutingConfiguration <PSRoutingConfiguration>] [-AsJob] [-DefaultProfile <IAzureContextContainer>]
[-AuthorizationKey <String>] [-RoutingWeight <UInt32>] [-EnableInternetSecurity] [-ExpressRouteGatewayBypass] [-RoutingConfiguration <PSRoutingConfiguration>] [-AsJob] [-DefaultProfile <IAzureContextContainer>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

### ByExpressRouteConnectionResourceId
```
Set-AzExpressRouteConnection -ResourceId <String> [-AuthorizationKey <String>] [-RoutingWeight <UInt32>]
[-EnableInternetSecurity] [-RoutingConfiguration <PSRoutingConfiguration>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-EnableInternetSecurity] [-ExpressRouteGatewayBypass] [-RoutingConfiguration <PSRoutingConfiguration>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### ByExpressRouteConnectionObject
```
Set-AzExpressRouteConnection -InputObject <PSExpressRouteConnection> [-AuthorizationKey <String>]
[-RoutingWeight <UInt32>] [-EnableInternetSecurity] [-RoutingConfiguration <PSRoutingConfiguration>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
[-RoutingWeight <UInt32>] [-EnableInternetSecurity] [-ExpressRouteGatewayBypass] [-RoutingConfiguration <PSRoutingConfiguration>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

Expand Down Expand Up @@ -145,6 +145,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -ExpressRouteGatewayBypass
Bypass ExpressRoute Gateway for this ExpressRoute Gateway connection

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

### -ExpressRouteGatewayName
The parent resource name.

Expand Down Expand Up @@ -298,4 +313,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## RELATED LINKS

[New-AzRoutingConfiguration](./New-AzRoutingConfiguration.md)
[New-AzRoutingConfiguration](./New-AzRoutingConfiguration.md)
Original file line number Diff line number Diff line change
Expand Up @@ -372,3 +372,5 @@
"Microsoft.Azure.PowerShell.Cmdlets.Network.dll","Microsoft.Azure.Commands.Network.Bastion.GetAzBastionCommand","Get-AzBastion","1","8700","Parameter set 'ListByResourceGroupName', '__AllParameterSets' of cmdlet 'Get-AzBastion' have the same mandatory parameters, and both of them are not default parameter set which may cause confusion.","Merge these parameter sets into one parameter set."
"Microsoft.Azure.PowerShell.Cmdlets.Network.dll","Microsoft.Azure.Commands.Network.NewAzureRmExpressRoutePortLOA","New-AzExpressRoutePortLOA","1","8100","New-AzExpressRoutePortLOA Does not support ShouldProcess but the cmdlet verb New indicates that it should.","Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue"
"Microsoft.Azure.PowerShell.Cmdlets.Network.dll","Microsoft.Azure.Commands.Network.NewAzureRmO365PolicyPropertyCommand","New-AzO365PolicyProperty","1","8100","New-AzO365PolicyProperty Does not support ShouldProcess but the cmdlet verb New indicates that it should.","Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue"
"Microsoft.Azure.PowerShell.Cmdlets.Network.dll","Microsoft.Azure.Commands.Network.NewAzureRmExpressRouteConnectionCommand","New-AzExpressRouteConnection","1","8410","Parameter ExpressRouteGatewayBypass of cmdlet New-AzExpressRouteConnection 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."
"Microsoft.Azure.PowerShell.Cmdlets.Network.dll","Microsoft.Azure.Commands.Network.Cortex.ExpressRouteGateway.UpdateAzureRmExpressRouteConnectionCommand","Set-AzExpressRouteConnection","1","8410","Parameter ExpressRouteGatewayBypass of cmdlet Set-AzExpressRouteConnection 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."