Edit

Share via


Set-AzApplicationGatewayRedirectConfiguration

Sets the redirect configuration on an existing Application Gateway.

Syntax

SetByResourceId

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

SetByResource

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

SetByURL

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

Description

The Set-AzApplicationGatewayRequestRoutingRule cmdlet modifies a redirect configuration.

Examples

Example 1

$AppGw = Get-AzApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01"
$AppGw =  Set-AzApplicationGatewayRedirectConfiguration -ApplicationGateway $appgw -Name "RedirectConfig01" -RedirectType Permanent -TargetUrl "https://www.contoso.com"

The first command gets the application gateway named ApplicationGateway01 and stores it in the $AppGw variable. The second command modifies the redirect configuration for the application gateway to redirect type Permanent and use a target url.

Example 2

Sets the redirect configuration on an existing Application Gateway. (autogenerated)

Set-AzApplicationGatewayRedirectConfiguration -ApplicationGateway <PSApplicationGateway> -IncludePath $false -IncludeQueryString $false -Name 'RedirectConfig01' -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