Edit

Share via


Set-AzExpressRouteGateway

Updates a Scalable ExpressRoute Gateway.

Syntax

ByExpressRouteGatewayName (Default)

Set-AzExpressRouteGateway
    -ResourceGroupName <String>
    -Name <String>
    [-MinScaleUnits <UInt32>]
    [-MaxScaleUnits <UInt32>]
    [-AllowNonVirtualWanTraffic <Boolean>]
    [-Tag <Hashtable>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByExpressRouteGatewayObject

Set-AzExpressRouteGateway
    -InputObject <PSExpressRouteGateway>
    [-MinScaleUnits <UInt32>]
    [-MaxScaleUnits <UInt32>]
    [-AllowNonVirtualWanTraffic <Boolean>]
    [-Tag <Hashtable>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByExpressRouteGatewayResourceId

Set-AzExpressRouteGateway
    -ResourceId <String>
    [-MinScaleUnits <UInt32>]
    [-MaxScaleUnits <UInt32>]
    [-AllowNonVirtualWanTraffic <Boolean>]
    [-Tag <Hashtable>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Set-AzExpressRouteGateway cmdlet enables you to update the scale units for an existing ExpressRouteGateway or update the resource tags.

Examples

Example 1

New-AzResourceGroup -Location "West US" -Name "testRG"
$virtualWan = New-AzVirtualWan -ResourceGroupName testRG -Name myVirtualWAN -Location "West US"
$virtualHub = New-AzVirtualHub -VirtualWan $virtualWan -ResourceGroupName "testRG" -Name "westushub" -AddressPrefix "10.0.0.1/24"
New-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testergw" -VirtualHubId $virtualHub.Id -MinScaleUnits 2
Set-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testergw" -MinScaleUnits 3
ResourceGroupName   : testRG
Name                : testergw
Id                  : /subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/expressRouteGateways/testergw
Location            : West US
MinScaleUnits       : 3
Type                : Microsoft.Network/expressRouteGateways
ProvisioningState   : Succeeded

The above will create a resource group "testRG", a Virtual WAN and a Virtual Hub in West US in that resource group in Azure. An ExpressRoute gateway will be created thereafter in the Virtual Hub with 2 scale units which will then be modified to 3 scale units.

Example 2: Configure this gateway to accept traffic from non Virtual Wan networks.

You may either retrieve the gateway, configure its AllowNonVirtualWanTraffic property and save the changes on the gateway or you may just use the switch on the Set-AzExpressRouteGateway cmdlet

# Option 1 - Retrieve the gateway object, configure it to allow traffic from VNets and persist those changes.
$gateway = Get-AzExpressRouteGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
$gateway.AllowNonVirtualWanTraffic = $true
$gateway = Set-AzExpressRouteGateway -InputObject $gateway

# Option 2 - Use the cmdlet switch
Set-AzExpressRouteGateway -ResourceGroupName "resourceGroup001" -Name "gateway001" -AllowNonVirtualWanTraffic $true

Example 3: Configure this gateway to block traffic from non Virtual Wan networks.

You may either retrieve the gateway, configure its AllowNonVirtualWanTraffic property and save the changes on the gateway or you may just use the switch on the Set-AzExpressRouteGateway cmdlet

# Option 1 - Retrieve the gateway object, configure it to block traffic from VNets and persist those changes.
$gateway=Get-AzExpressRouteGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
$gateway.AllowNonVirtualWanTraffic = $false
$gateway = Set-AzExpressRouteGateway -InputObject $gateway

# Option 2 - Use the cmdlet switch
Set-AzExpressRouteGateway -ResourceGroupName "resourceGroup001" -Name "gateway001" -AllowNonVirtualWanTraffic $false

Parameters

-AllowNonVirtualWanTraffic

Determines whether this gateway should accept traffic from other VNets

Parameter properties

Type:

Nullable<T>[Boolean]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-AsJob

Run cmdlet in the background

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

The ExpressRouteGateway that needs to be updated.

Parameter properties

Type:PSExpressRouteGateway
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ExpressRouteGateway

Parameter sets

ByExpressRouteGatewayObject
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-MaxScaleUnits

The maximum number of scale units for this ExpressRouteGateway. Valid range > 2

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MinScaleUnits

The minimum number of scale units for this ExpressRouteGateway. Valid range > 2

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

The resource name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ResourceName, ExpressRouteGatewayName, GatewayName

Parameter sets

ByExpressRouteGatewayName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

The resource group name of the ExpressRouteGateway to be updated.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByExpressRouteGatewayName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceId

The Id of the ExpressRouteGateway that needs to be updated.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByExpressRouteGatewayResourceId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Tag

A hashtable which represents resource tags.

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

PSVirtualHub

String

Outputs

PSExpressRouteGateway