Edit

Share via


Add-AzApplicationGatewayRedirectConfiguration

Adds a redirect configuration to an Application Gateway.

Syntax

SetByResourceId

Add-AzApplicationGatewayRedirectConfiguration
    -ApplicationGateway <PSApplicationGateway>
    -Name <String>
    -RedirectType <String>
    [-TargetListenerID <String>]
    [-IncludePath <Boolean>]
    [-IncludeQueryString <Boolean>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

SetByResource

Add-AzApplicationGatewayRedirectConfiguration
    -ApplicationGateway <PSApplicationGateway>
    -Name <String>
    -RedirectType <String>
    [-TargetListener <PSApplicationGatewayHttpListener>]
    [-IncludePath <Boolean>]
    [-IncludeQueryString <Boolean>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

SetByURL

Add-AzApplicationGatewayRedirectConfiguration
    -ApplicationGateway <PSApplicationGateway>
    -Name <String>
    -RedirectType <String>
    [-TargetUrl <String>]
    [-IncludePath <Boolean>]
    [-IncludeQueryString <Boolean>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Add-AzApplicationGatewayRedirectConfiguration cmdlet adds a redirect configuration to an Application Gateway.

Examples

Example 1

$AppGw = Get-AzApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01"
$Appgw = Add-AzApplicationGatewayRedirectConfiguration -ApplicationGateway $AppGw -Name "Redirect01" -RedirectType Permanent -TargetListener $listener01

The first command gets the application gateway and stores it in the $AppGw variable. The second command adds the redirect configuration to the application gateway.

Example 2

Adds a redirect configuration to an Application Gateway. (autogenerated)

Add-AzApplicationGatewayRedirectConfiguration -ApplicationGateway <PSApplicationGateway> -IncludePath $false -IncludeQueryString $false -Name 'Redirect01' -RedirectType Permanent -TargetListener <PSApplicationGatewayHttpListener>

Parameters

-ApplicationGateway

The applicationGateway

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
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

-IncludePath

Include path in the redirected url. Default is true.

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:False
Value from remaining arguments:False

-IncludeQueryString

Include query string in the redirected url. Default is true.

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:False
Value from remaining arguments:False

-Name

The name of the Redirect Configuration

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

-RedirectType

The type of redirect

Parameter properties

Type:String
Default value:None
Accepted values:Permanent, Found, SeeOther, Temporary
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

-TargetListener

HTTP listener to redirect the request to

Parameter properties

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

Parameter sets

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

-TargetListenerID

ID of HTTP listener to redirect the request to

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

-TargetUrl

Target URL fo redirection

Parameter properties

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

Parameter sets

SetByURL
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

PSApplicationGateway

Outputs

PSApplicationGateway