az network front-door routing-rule

Note

This reference is part of the front-door extension for the Azure CLI (version 2.0.68 or higher). The extension will automatically install the first time you run an az network front-door routing-rule command. Learn more about extensions.

Manage Front Door routing rules.

Commands

Name Description Type Status
az network front-door routing-rule create

Create a Front Door routing rule.

Extension GA
az network front-door routing-rule delete

Delete a Front Door routing rule.

Extension GA
az network front-door routing-rule list

List Front Door routing rules.

Extension GA
az network front-door routing-rule show

Get the details of a Front Door routing rule.

Extension GA
az network front-door routing-rule update

Update a Front Door routing rule.

Extension GA

az network front-door routing-rule create

Create a Front Door routing rule.

Create a Front Door routing rule to either forward the requests to a backend or redirect the users to a different URL.

Example 1: az network front-door routing-rule create -f frontdoor1 -g rg1 --frontend-endpoints DefaultFrontendEndpoint --route-type Forward --backend-pool DefaultBackendPool -n forwardRoutingrule1 --patterns /forward1

Example 2: az network front-door routing-rule create -f frontdoor1 -g rg1 --frontend-endpoints DefaultFrontendEndpoint --route-type Redirect --custom-host redirecthost.com -n redirectRouteRule1 --patterns /redirect1 --custom-query-string querystring.

az network front-door routing-rule create --front-door-name
                                          --frontend-endpoints
                                          --name
                                          --resource-group
                                          --route-type {Forward, Redirect}
                                          [--accepted-protocols]
                                          [--backend-pool]
                                          [--cache-duration]
                                          [--caching {Disabled, Enabled}]
                                          [--custom-forwarding-path]
                                          [--custom-fragment]
                                          [--custom-host]
                                          [--custom-path]
                                          [--custom-query-string]
                                          [--disabled {false, true}]
                                          [--dynamic-compression {Disabled, Enabled}]
                                          [--forwarding-protocol {HttpOnly, HttpsOnly, MatchRequest}]
                                          [--patterns]
                                          [--query-parameter-strip-directive {StripAll, StripAllExcept, StripNone, StripOnly}]
                                          [--query-parameters]
                                          [--redirect-protocol {HttpOnly, HttpsOnly, MatchRequest}]
                                          [--redirect-type {Found, Moved, PermanentRedirect, TemporaryRedirect}]
                                          [--rules-engine]

Required Parameters

--front-door-name -f

Name of the Front Door.

--frontend-endpoints

Space-separated list of frontend endpoint names or IDs.

--name -n

Name of the routing rule.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--route-type

Route type to define how Front Door should handle requests for this route i.e. forward them to a backend or redirect the users to a different URL.

accepted values: Forward, Redirect

Optional Parameters

--accepted-protocols

Space-separated list of protocols to accept. Default: Http.

--backend-pool

Name or ID of a backend pool. It's required to create a Forward routing rule.

--cache-duration

The duration for which the content needs to be cached. Allowed format is ISO 8601 duration.

--caching

Whether to enable caching for this route.

accepted values: Disabled, Enabled
--custom-forwarding-path

Custom path used to rewrite resource paths matched by this rule. Leave empty to use incoming path.

--custom-fragment

Fragment to add to the redirect URL. Fragment is the part of the URL that comes after #. Do not include the #.

--custom-host

Host to redirect. Leave empty to use use the incoming host as the destination host.

--custom-path

The full path to redirect. Path cannot be empty and must start with /. Leave empty to use the incoming path as destination path.

--custom-query-string

The set of query strings to be placed in the redirect URL. Setting this value would replace any existing query string; leave empty to preserve the incoming query string. Query string must be in = format. The first ? and & will be added automatically so do not include them in the front, but do separate multiple query strings with &.

--disabled

Create in a disabled state.

accepted values: false, true
--dynamic-compression

Use dynamic compression for cached content.

accepted values: Disabled, Enabled
--forwarding-protocol

Protocol to use for forwarding traffic.

accepted values: HttpOnly, HttpsOnly, MatchRequest
--patterns

Space-separated list of patterns to match. Default: '/*'.

--query-parameter-strip-directive

Treatment of URL query terms when forming the cache key.

accepted values: StripAll, StripAllExcept, StripNone, StripOnly
--query-parameters

Query parameters to include or exclude (comma separated) when using query-parameter-strip-directive type StripAllExcept or StripOnly respectively.

--redirect-protocol

The protocol of the destination to where the traffic is redirected.

accepted values: HttpOnly, HttpsOnly, MatchRequest
default value: MatchRequest
--redirect-type

The redirect type the rule will use when redirecting traffic.

accepted values: Found, Moved, PermanentRedirect, TemporaryRedirect
default value: Moved
--rules-engine

Name or ID of a Rules Engine configuration. To unlink property, "--remove rulesEngine".

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network front-door routing-rule delete

Delete a Front Door routing rule.

az network front-door routing-rule delete --front-door-name
                                          --name
                                          --resource-group

Required Parameters

--front-door-name -f

Name of the Front Door.

--name -n

Name of the routing rule.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network front-door routing-rule list

List Front Door routing rules.

az network front-door routing-rule list --front-door-name
                                        --resource-group

Required Parameters

--front-door-name -f

Name of the Front Door.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network front-door routing-rule show

Get the details of a Front Door routing rule.

az network front-door routing-rule show --front-door-name
                                        --name
                                        --resource-group

Required Parameters

--front-door-name -f

Name of the Front Door.

--name -n

Name of the routing rule.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az network front-door routing-rule update

Update a Front Door routing rule.

az network front-door routing-rule update --front-door-name
                                          --name
                                          --resource-group
                                          [--accepted-protocols]
                                          [--add]
                                          [--backend-pool]
                                          [--cache-duration]
                                          [--caching {Disabled, Enabled}]
                                          [--custom-forwarding-path]
                                          [--custom-fragment]
                                          [--custom-host]
                                          [--custom-path]
                                          [--custom-query-string]
                                          [--dynamic-compression {Disabled, Enabled}]
                                          [--enabled {Disabled, Enabled}]
                                          [--force-string]
                                          [--forwarding-protocol {HttpOnly, HttpsOnly, MatchRequest}]
                                          [--frontend-endpoints]
                                          [--patterns]
                                          [--query-parameter-strip-directive {StripAll, StripAllExcept, StripNone, StripOnly}]
                                          [--query-parameters]
                                          [--redirect-protocol {HttpOnly, HttpsOnly, MatchRequest}]
                                          [--redirect-type {Found, Moved, PermanentRedirect, TemporaryRedirect}]
                                          [--remove]
                                          [--rules-engine]
                                          [--set]

Required Parameters

--front-door-name -f

Name of the Front Door.

--name -n

Name of the routing rule.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--accepted-protocols

Space-separated list of protocols to accept. Default: Http.

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

default value: []
--backend-pool

Name or ID of a backend pool. It's required to create a Forward routing rule.

--cache-duration

The duration for which the content needs to be cached. Allowed format is ISO 8601 duration.

--caching

Whether to enable caching for this route.

accepted values: Disabled, Enabled
--custom-forwarding-path

Custom path used to rewrite resource paths matched by this rule. Leave empty to use incoming path.

--custom-fragment

Fragment to add to the redirect URL. Fragment is the part of the URL that comes after #. Do not include the #.

--custom-host

Host to redirect. Leave empty to use use the incoming host as the destination host.

--custom-path

The full path to redirect. Path cannot be empty and must start with /. Leave empty to use the incoming path as destination path.

--custom-query-string

The set of query strings to be placed in the redirect URL. Setting this value would replace any existing query string; leave empty to preserve the incoming query string. Query string must be in = format. The first ? and & will be added automatically so do not include them in the front, but do separate multiple query strings with &.

--dynamic-compression

Use dynamic compression for cached content.

accepted values: Disabled, Enabled
--enabled

Enabled status.

accepted values: Disabled, Enabled
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

default value: False
--forwarding-protocol

Protocol to use for forwarding traffic.

accepted values: HttpOnly, HttpsOnly, MatchRequest
--frontend-endpoints

Space-separated list of frontend endpoint names or IDs.

--patterns

Space-separated list of patterns to match. Default: '/*'.

--query-parameter-strip-directive

Treatment of URL query terms when forming the cache key.

accepted values: StripAll, StripAllExcept, StripNone, StripOnly
--query-parameters

Query parameters to include or exclude (comma separated) when using query-parameter-strip-directive type StripAllExcept or StripOnly respectively.

--redirect-protocol

The protocol of the destination to where the traffic is redirected.

accepted values: HttpOnly, HttpsOnly, MatchRequest
--redirect-type

The redirect type the rule will use when redirecting traffic.

accepted values: Found, Moved, PermanentRedirect, TemporaryRedirect
--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

default value: []
--rules-engine

Name or ID of a Rules Engine configuration. To unlink property, "--remove rulesEngine".

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

default value: []
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.