Edit

Share via


New-AzApplicationGatewayRedirectConfiguration

Creates a redirect configuration for an application gateway.

Syntax

SetByResourceId

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

SetByResource

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

SetByURL

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

Description

The New-AzApplicationGatewayRedirectConfiguration cmdlet creates a redirect configuration for an application gateway.

Examples

Example 1

$RedirectConfig = New-AzApplicationGatewayRedirectConfiguration -Name "Redirect01" -RedirectType Permanent -TargetListener $listener01

This command creates a redirect configuration named Redirect01 and stores the result in the variable named $RedirectConfig.

Example 2

Creates a redirect configuration for an application gateway. (autogenerated)

New-AzApplicationGatewayRedirectConfiguration -IncludePath $false -IncludeQueryString $false -Name 'Redirect01' -RedirectType Permanent -TargetListener <PSApplicationGatewayHttpListener>

Parameters

-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

None

Outputs

PSApplicationGatewayRedirectConfiguration