Add-AzApplicationGatewayRoutingRule
Adds a routing rule to an application gateway.
Syntax
SetByResource (Default)
Add-AzApplicationGatewayRoutingRule
-ApplicationGateway <PSApplicationGateway>
-Name <String>
-RuleType <String>
-Priority <Int32>
[-BackendSettings <PSApplicationGatewayBackendSettings>]
[-Listener <PSApplicationGatewayListener>]
[-BackendAddressPool <PSApplicationGatewayBackendAddressPool>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
SetByResourceId
Add-AzApplicationGatewayRoutingRule
-ApplicationGateway <PSApplicationGateway>
-Name <String>
-RuleType <String>
-Priority <Int32>
[-BackendSettingsId <String>]
[-ListenerId <String>]
[-BackendAddressPoolId <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Add-AzApplicationGatewayRoutingRule cmdlet adds a routing rule to an application gateway.
Examples
Example 1: Add a routing rule to an application gateway
$AppGw = Get-AzApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01"
$Appgw = Add-AzApplicationGatewayRoutingRule -ApplicationGateway $AppGw -Name "Rule01" -RuleType Basic -Priority 100 -BackendSettings $Setting -Listener $Listener -BackendAddressPool $Pool
The first command gets the application gateway and stores it in the $AppGw variable.
The second command adds the routing rule to the application gateway.
Parameters
-ApplicationGateway
The applicationGateway
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-BackendAddressPool
Application gateway BackendAddressPool
Parameter properties
Parameter sets
SetByResource
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-BackendAddressPoolId
ID of the application gateway BackendAddressPool
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
SetByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-BackendSettings
Application gateway BackendSettings
Parameter properties
Parameter sets
SetByResource
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-BackendSettingsId
ID of the application gateway BackendSettings
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
SetByResourceId
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
-Listener
Application gateway Listener
Parameter properties
Parameter sets
SetByResource
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ListenerId
ID of the application gateway Listener
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
SetByResourceId
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
The name of the Routing Rule
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Priority
The priority of the rule
Parameter properties
Type: Nullable<T> [ Int32 ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-RuleType
The type of rule
Parameter properties
Type: String
Default value: None
Accepted values: Basic, PathBasedRouting
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
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 .
Outputs