Edit

New-AzApplicationGatewayAdvancedRoutingCondition

Creates a routing condition for an application gateway advanced routing condition set.

Syntax

MatchByValues (Default)

New-AzApplicationGatewayAdvancedRoutingCondition
    -ConditionType <String>
    -PropertyValues <String[]>
    [-PropertyName <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-AcquirePolicyToken]
    [-ChangeReference <String>]
    [<CommonParameters>]

MatchByPattern

New-AzApplicationGatewayAdvancedRoutingCondition
    -ConditionType <String>
    -Pattern <String>
    [-PropertyName <String>]
    [-IgnoreCase]
    [-Negate]
    [-DefaultProfile <IAzureContextContainer>]
    [-AcquirePolicyToken]
    [-ChangeReference <String>]
    [<CommonParameters>]

Description

The New-AzApplicationGatewayAdvancedRoutingCondition cmdlet creates a condition that is evaluated against a property of the incoming request. Use PropertyValues to match the property against a list of literal values, or Pattern to match it against a fixed string or a regular expression. Exactly one of the two must be supplied. PropertyName is required when ConditionType is Header or QueryString, and does not apply when it is Path, ClientIP or Method.

Examples

Example 1: Create a condition that matches a request header against literal values

$condition = New-AzApplicationGatewayAdvancedRoutingCondition -ConditionType Header -PropertyName "X-Region" -PropertyValues "emea", "apac"

This command creates a condition that matches when the X-Region request header is either emea or apac.

Example 2: Create a condition that matches the request path against a regular expression

$condition = New-AzApplicationGatewayAdvancedRoutingCondition -ConditionType Path -Pattern "^/api/v2/.*" -IgnoreCase

This command creates a condition that matches any request path beginning with /api/v2/, ignoring case.

Parameters

-AcquirePolicyToken

Acquire an Azure Policy token automatically for this resource operation.

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

-ChangeReference

The change reference resource ID for this resource operation.

Parameter properties

Type:String
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

-ConditionType

The type of request property the condition is evaluated against

Parameter properties

Type:String
Default value:None
Accepted values:Header, QueryString, Path, ClientIP, Method
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

-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

-IgnoreCase

Set this flag to make the pattern comparison case insensitive

Parameter properties

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

Parameter sets

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

-Negate

Set this flag to negate the condition given by the pattern

Parameter properties

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

Parameter sets

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

-Pattern

Pattern, either a fixed string or a regular expression, the request property is matched against. Not applicable when ConditionType is ClientIP or Method

Parameter properties

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

Parameter sets

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

-PropertyName

Name of the request property the condition is evaluated against. Required when ConditionType is Header or QueryString, and not applicable when ConditionType is Path, ClientIP or Method

Parameter properties

Type:String
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

-PropertyValues

Values the request property is matched against

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

MatchByValues
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.

Inputs

None

Outputs

PSApplicationGatewayAdvancedRoutingCondition