Share via


az cdn endpoint rule

This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Manage delivery rules for an endpoint.

Commands

Name Description Type Status
az cdn endpoint rule action

Manage delivery rule actions for an endpoint.

Core Preview
az cdn endpoint rule action add

Add an action to a delivery rule.

Core Preview
az cdn endpoint rule action remove

Remove an action from a delivery rule.

Core Preview
az cdn endpoint rule action show

Show delivery rules asscociate with the endpoint.

Core Preview
az cdn endpoint rule add

Add a delivery rule to a CDN endpoint.

Core Preview
az cdn endpoint rule condition

Manage delivery rule conditions for an endpoint.

Core Preview
az cdn endpoint rule condition add

Add a condition to a delivery rule.

Core Preview
az cdn endpoint rule condition remove

Remove a condition from a delivery rule.

Core Preview
az cdn endpoint rule condition show

Show delivery rules associate with the endpoint.

Core Preview
az cdn endpoint rule remove

Remove a delivery rule from an endpoint.

Core Preview
az cdn endpoint rule show

Show delivery rules associate with the endpoint.

Core Preview

az cdn endpoint rule add

Preview

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

Add a delivery rule to a CDN endpoint.

az cdn endpoint rule add --action-name {CacheExpiration, CacheKeyQueryString, ModifyRequestHeader, ModifyResponseHeader, OriginGroupOverride, UrlRedirect, UrlRewrite}
                         --order
                         [--cache-behavior {BypassCache, Override, SetIfMissing}]
                         [--cache-duration]
                         [--custom-fragment]
                         [--custom-hostname]
                         [--custom-path]
                         [--custom-querystring]
                         [--destination]
                         [--header-action {Append, Delete, Overwrite}]
                         [--header-name]
                         [--header-value]
                         [--ids]
                         [--match-values]
                         [--match-variable {ClientPort, Cookies, HostName, HttpVersion, IsDevice, PostArgs, QueryString, RemoteAddress, RequestBody, RequestHeader, RequestMethod, RequestScheme, RequestUri, ServerPort, SocketAddr, SslProtocol, UrlFileExtension, UrlFileName, UrlPath}]
                         [--name]
                         [--negate-condition {false, true}]
                         [--operator]
                         [--origin-group]
                         [--preserve-unmatched-path {false, true}]
                         [--profile-name]
                         [--query-parameters]
                         [--query-string-behavior {Exclude, ExcludeAll, Include, IncludeAll}]
                         [--redirect-protocol {Http, Https, MatchRequest}]
                         [--redirect-type {Found, Moved, PermanentRedirect, TemporaryRedirect}]
                         [--resource-group]
                         [--rule-name]
                         [--selector]
                         [--source-pattern]
                         [--subscription]
                         [--transform {Lowercase, Uppercase}]

Examples

Create a global rule to disable caching.

az cdn endpoint rule add -g group -n endpoint --profile-name profile --order 0 --rule-name global --action-name CacheExpiration --cache-behavior BypassCache

Create a rule for http to https redirect.

az cdn endpoint rule add -g group -n endpoint --profile-name profile --order 1 --rule-name "redirect" --match-variable RequestScheme --operator Equal --match-values HTTP --action-name "UrlRedirect" --redirect-protocol Https --redirect-type Moved

Create a rule to distribute requests with "/test1" in its URL path to origin group with name "origingroup1".

az cdn endpoint rule add -g group -n endpoint --profile-name profile --order 1 --rule-name "origin-group-override" --match-variable UrlPath --operator Contains --match-values /test1 --action-name "OriginGroupOverride" --origin-group origingroup1

Required Parameters

--action-name

The name of the action for the delivery rule: https://docs.microsoft.com/en-us/azure/cdn/cdn-standard-rules-engine-actions.

Accepted values: CacheExpiration, CacheKeyQueryString, ModifyRequestHeader, ModifyResponseHeader, OriginGroupOverride, UrlRedirect, UrlRewrite
--order

The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lower order will be applied before one with a higher order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied.

Optional Parameters

--cache-behavior

Caching behavior for the requests.

Accepted values: BypassCache, Override, SetIfMissing
--cache-duration

The duration for which the content needs to be cached. Allowed format is hh:mm:ss.xxxxxx.

--custom-fragment

Fragment to add to the redirect URL.

--custom-hostname

Host to redirect. Leave empty to 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-querystring

The set of query strings to be placed in the redirect URL. leave empty to preserve the incoming query string.

--destination

The destination path to be used in the rewrite.

--header-action

Header action for the requests.

Accepted values: Append, Delete, Overwrite
--header-name

Name of the header to modify.

--header-value

Value of the header.

--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.

--match-values

Match values of the match condition. e.g, space separated values "GET" "HTTP".

--match-variable

Name of the match condition: https://docs.microsoft.com/en-us/azure/cdn/cdn-standard-rules-engine-match-conditions.

Accepted values: ClientPort, Cookies, HostName, HttpVersion, IsDevice, PostArgs, QueryString, RemoteAddress, RequestBody, RequestHeader, RequestMethod, RequestScheme, RequestUri, ServerPort, SocketAddr, SslProtocol, UrlFileExtension, UrlFileName, UrlPath
--name -n

Name of the CDN endpoint.

--negate-condition

If true, negates the condition.

Accepted values: false, true
--operator

Operator of the match condition.

--origin-group

Name or ID of the OriginGroup that would override the default OriginGroup.

--preserve-unmatched-path

If True, the remaining path after the source pattern will be appended to the new destination path.

Accepted values: false, true
--profile-name

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

--query-parameters

Query parameters to include or exclude (comma separated).

--query-string-behavior

Query string behavior for the requests.

Accepted values: Exclude, ExcludeAll, Include, IncludeAll
--redirect-protocol

Protocol to use for the redirect.

Accepted values: Http, Https, MatchRequest
--redirect-type

The redirect type the rule will use when redirecting traffic.

Accepted values: Found, Moved, PermanentRedirect, TemporaryRedirect
--resource-group -g

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

--rule-name

Name of the rule, only required for Microsoft SKU.

--selector

Selector of the match condition.

--source-pattern

A request URI pattern that identifies the type of requests that may be rewritten.

--subscription

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

--transform

Transform to apply before matching.

Accepted values: Lowercase, Uppercase
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 cdn endpoint rule remove

Preview

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

Remove a delivery rule from an endpoint.

az cdn endpoint rule remove [--ids]
                            [--name]
                            [--order]
                            [--profile-name]
                            [--resource-group]
                            [--rule-name]
                            [--subscription]

Examples

Remove the global rule.

az cdn endpoint rule remove -g group -n endpoint --profile-name profile --rule-name Global

Remove the rule with the order 4.

az cdn endpoint rule remove -g group -n endpoint --profile-name profile --order 4

Optional Parameters

--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.

--name -n

Name of the CDN endpoint.

--order

The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lower order will be applied before one with a higher order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied.

--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>.

--rule-name

Name of the rule.

--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 cdn endpoint rule show

Preview

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

Show delivery rules associate with the endpoint.

az cdn endpoint rule show [--ids]
                          [--name]
                          [--profile-name]
                          [--resource-group]
                          [--subscription]

Examples

show delivery rules associate with the endpoint.

az cdn endpoint rule show -g group -n endpoint --profile-name profile

Optional Parameters

--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.

--name -n

Name of the CDN 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>.

--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.