az afd route

Command group 'afd' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Manage routes under an AFD endpoint.

A route maps your domains and matching URL path patterns to a specific origin group.

Commands

Name Description Type Status
az afd route create

Creates a new route within the specified endpoint.

Core Preview
az afd route delete

Delete an existing route within the specified endpoint.

Core Preview
az afd route list

List all the routes within the specified endpoint.

Core Preview
az afd route show

Show route details.

Core Preview
az afd route update

Update an existing route within the specified endpoint.

Core Preview

az afd route create

Preview

Command group 'afd' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Creates a new route within the specified endpoint.

az afd route create --endpoint-name
                    --forwarding-protocol {HttpOnly, HttpsOnly, MatchRequest}
                    --https-redirect {Disabled, Enabled}
                    --origin-group
                    --profile-name
                    --resource-group
                    --route-name
                    --supported-protocols {Http, Https}
                    [--content-types-to-compress]
                    [--custom-domains]
                    [--enable-caching {false, true}]
                    [--enable-compression {false, true}]
                    [--enabled-state {Disabled, Enabled}]
                    [--link-to-default-domain {Disabled, Enabled}]
                    [--origin-path]
                    [--patterns-to-match]
                    [--query-parameters]
                    [--query-string-caching-behavior {IgnoreQueryString, IgnoreSpecifiedQueryStrings, IncludeSpecifiedQueryStrings, UseQueryString}]
                    [--rule-sets]

Examples

Creates a route to associate the endpoint's default domain with an origin group for all HTTPS requests.

az afd route create -g group --endpoint-name endpoint1 --profile-name profile --route-name route1 --https-redirect Disabled --origin-group og001 --supported-protocols Https --link-to-default-domain Enabled --forwarding-protocol MatchRequest

Creates a route to associate the endpoint's default domain with an origin group for all requests and use the specified rule sets to customize the route behavior.

az afd route create -g group --endpoint-name endpoint1 --profile-name profile --route-name route1 --rule-sets ruleset1 rulseset2 --origin-group og001 --supported-protocols Http Https --link-to-default-domain Enabled --forwarding-protocol MatchRequest --https-redirect Disabled

Creates a route to associate the endpoint's default domain and a custom domain with an origin group for all requests with the specified path patterns and redirect all trafic to use Https.

az afd route create -g group --endpoint-name endpoint1 --profile-name profile --route-name route1 --patterns-to-match /test1/* /tes2/* --origin-group og001 --supported-protocols Http Https --custom-domains cd001 --forwarding-protocol MatchRequest --https-redirect Enabled --link-to-default-domain Enabled

Required Parameters

--endpoint-name

Name of the endpoint.

--forwarding-protocol

Protocol this rule will use when forwarding traffic to backends.

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

Whether to automatically redirect HTTP traffic to HTTPS traffic.

accepted values: Disabled, Enabled
--origin-group

Name or ID of the origin group to be associated with.

--profile-name

Name of the CDN profile which is unique within the resource group.

--resource-group -g

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

--route-name

Name of the route.

--supported-protocols

List of supported protocols for this route.

accepted values: Http, Https

Optional Parameters

--content-types-to-compress

List of content types on which compression applies. The value should be a valid MIME type.

--custom-domains

Custom domains referenced by this endpoint.

--enable-caching

Indicates whether caching is enanbled on that route.

accepted values: false, true
default value: False
--enable-compression

Indicates whether content compression is enabled on AzureFrontDoor. Default value is false. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB.

accepted values: false, true
default value: False
--enabled-state

Whether to enable this route.

accepted values: Disabled, Enabled
default value: Enabled
--link-to-default-domain

Whether this route will be linked to the default endpoint domain.

accepted values: Disabled, Enabled
default value: Disabled
--origin-path

A directory path on the origin that Azure Front Door can use to retrieve content from.

--patterns-to-match

The route patterns of the rule.

--query-parameters

Query parameters to include or exclude.

--query-string-caching-behavior

Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL.

accepted values: IgnoreQueryString, IgnoreSpecifiedQueryStrings, IncludeSpecifiedQueryStrings, UseQueryString
--rule-sets

Collection of ID or name of rule set referenced by the route.

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 afd route delete

Preview

Command group 'afd' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Delete an existing route within the specified endpoint.

az afd route delete [--endpoint-name]
                    [--ids]
                    [--profile-name]
                    [--resource-group]
                    [--route-name]
                    [--subscription]
                    [--yes]

Examples

Delete a route named route1.

az afd route delete -g group --profile-name profile --endpoint-name endpoint1 --route-name route1

Optional Parameters

--endpoint-name

Name of the endpoint.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--profile-name

Name of the CDN profile which is unique within the resource group.

--resource-group -g

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

--route-name

Name of the route.

--subscription

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

--yes -y

Do not prompt for confirmation.

default value: False
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 afd route list

Preview

Command group 'afd' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List all the routes within the specified endpoint.

az afd route list --endpoint-name
                  --profile-name
                  --resource-group

Examples

List all the routes within the specified endpoint.

az afd route list -g group --profile-name profile --endpoint-name endpoint1

Required Parameters

--endpoint-name

Name of the endpoint.

--profile-name

Name of the CDN profile which is unique within the resource group.

--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 afd route show

Preview

Command group 'afd' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Show route details.

az afd route show [--endpoint-name]
                  [--ids]
                  [--profile-name]
                  [--resource-group]
                  [--route-name]
                  [--subscription]

Examples

show details of the route named route1.

az afd route show -g group --profile-name profile  --endpoint-name endpoint1 --route-name route1

Optional Parameters

--endpoint-name

Name of the endpoint.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--profile-name

Name of the CDN profile which is unique within the resource group.

--resource-group -g

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

--route-name

Name of the route.

--subscription

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

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 afd route update

Preview

Command group 'afd' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Update an existing route within the specified endpoint.

az afd route update [--content-types-to-compress]
                    [--custom-domains]
                    [--enable-caching {false, true}]
                    [--enable-compression {false, true}]
                    [--enabled-state {Disabled, Enabled}]
                    [--endpoint-name]
                    [--forwarding-protocol {HttpOnly, HttpsOnly, MatchRequest}]
                    [--https-redirect {Disabled, Enabled}]
                    [--ids]
                    [--link-to-default-domain {Disabled, Enabled}]
                    [--origin-group]
                    [--origin-path]
                    [--patterns-to-match]
                    [--profile-name]
                    [--query-parameters]
                    [--query-string-caching-behavior {IgnoreQueryString, IgnoreSpecifiedQueryStrings, IncludeSpecifiedQueryStrings, UseQueryString}]
                    [--resource-group]
                    [--route-name]
                    [--rule-sets]
                    [--subscription]
                    [--supported-protocols {Http, Https}]

Examples

Update a route to accept both Http and Https requests and redirect all trafic to use Https.

az afd route update -g group --endpoint-name endpoint1 --profile-name profile --route-name route1 --supported-protocols Http Https --https-redirect Enabled

Update a route's rule sets settings to customize the route behavior.

az afd route update -g group --endpoint-name endpoint1 --profile-name profile --route-name route1 --rule-sets ruleset1 rulseset2

Update a route's compression settings to enable compression for the specified content types.

az afd route update -g group --endpoint-name endpoint1 --profile-name profile --route-name route1 --query-string-caching-behavior IgnoreQueryString --enable-compression true --content-types-to-compress text/javascript text/plain

Optional Parameters

--content-types-to-compress

List of content types on which compression applies. The value should be a valid MIME type.

--custom-domains

Custom domains referenced by this endpoint.

--enable-caching

Indicates whether caching is enanbled on that route.

accepted values: false, true
--enable-compression

Indicates whether content compression is enabled on AzureFrontDoor. Default value is false. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB.

accepted values: false, true
--enabled-state

Whether to enable this route.

accepted values: Disabled, Enabled
--endpoint-name

Name of the endpoint.

--forwarding-protocol

Protocol this rule will use when forwarding traffic to backends.

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

Whether to automatically redirect HTTP traffic to HTTPS traffic.

accepted values: Disabled, Enabled
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--link-to-default-domain

Whether this route will be linked to the default endpoint domain.

accepted values: Disabled, Enabled
--origin-group

Name or ID of the origin group to be associated with.

--origin-path

A directory path on the origin that Azure Front Door can use to retrieve content from.

--patterns-to-match

The route patterns of the rule.

--profile-name

Name of the CDN profile which is unique within the resource group.

--query-parameters

Query parameters to include or exclude.

--query-string-caching-behavior

Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL.

accepted values: IgnoreQueryString, IgnoreSpecifiedQueryStrings, IncludeSpecifiedQueryStrings, UseQueryString
--resource-group -g

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

--route-name

Name of the route.

--rule-sets

Collection of ID or name of rule set referenced by the route.

--subscription

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

--supported-protocols

List of supported protocols for this route.

accepted values: Http, Https
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.