你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

az cdn endpoint rule

此命令组处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

管理终结点的传递规则。

命令

名称 说明 类型 状态
az cdn endpoint rule action

管理终结点的传递规则操作。

核心 预览
az cdn endpoint rule action add

将操作添加到传递规则。

核心 预览版
az cdn endpoint rule action remove

从传递规则中删除操作。

核心 预览
az cdn endpoint rule action show

使用终结点显示传递规则。

核心 预览
az cdn endpoint rule add

将传递规则添加到 CDN 终结点。

核心 预览
az cdn endpoint rule condition

管理终结点的传递规则条件。

核心 预览版
az cdn endpoint rule condition add

向传递规则添加条件。

核心 预览版
az cdn endpoint rule condition remove

从传递规则中删除条件。

核心 预览版
az cdn endpoint rule condition show

显示与终结点关联的传递规则。

核心 预览
az cdn endpoint rule remove

从终结点中删除传递规则。

核心 预览
az cdn endpoint rule show

显示与终结点关联的传递规则。

核心 预览

az cdn endpoint rule add

预览

命令组“cdn 终结点规则”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

将传递规则添加到 CDN 终结点。

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}]

示例

创建全局规则以禁用缓存。

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

为 http 到 https 重定向创建规则。

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

创建一个规则,以在其 URL 路径中使用“/test1”将请求分发到名称为“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

必需参数

--action-name

传递规则的操作的名称: https://docs.microsoft.com/en-us/azure/cdn/cdn-standard-rules-engine-actions

接受的值: CacheExpiration, CacheKeyQueryString, ModifyRequestHeader, ModifyResponseHeader, OriginGroupOverride, UrlRedirect, UrlRewrite
--order

为终结点应用规则的顺序。 可能的值 {0,1,2,3,.........}。 将应用顺序较低的规则,然后再应用一个具有较高顺序的规则。 具有顺序 0 的规则是一个特殊规则。 它不需要任何条件,并且它中列出的操作将始终应用。

可选参数

--cache-behavior

请求的缓存行为。

接受的值: BypassCache, Override, SetIfMissing
--cache-duration

需要缓存内容的持续时间。 允许的格式为 [d.]hh:mm:ss。

--custom-fragment

要添加到重定向 URL 的片段。

--custom-hostname

要重定向的主机。 将传入主机保留为空,以将传入主机用作目标主机。

--custom-path

要重定向的完整路径。 路径不能为空,必须以 /开头。 将传入路径保留为空,以用作目标路径。

--custom-querystring

要放置在重定向 URL 中的查询字符串集。 保留空以保留传入的查询字符串。

--destination

要在重写中使用的目标路径。

--header-action

请求的标头操作。

接受的值: Append, Delete, Overwrite
--header-name

要修改的标头的名称。

--header-value

标头的值。

--ids

一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--match-values

匹配条件的匹配值。 例如,空格分隔值“GET”“HTTP”。

--match-variable

匹配条件的名称: https://docs.microsoft.com/en-us/azure/cdn/cdn-standard-rules-engine-match-conditions

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

CDN 终结点的名称。

--negate-condition

如果为 true,则否定条件。

接受的值: false, true
--operator

匹配条件的运算符。

--origin-group

将替代默认 OriginGroup 的 OriginGroup 的名称或 ID。

--preserve-unmatched-path

如果为 True,则源模式后的剩余路径将追加到新的目标路径。

接受的值: false, true
--profile-name

资源组中唯一的 CDN 配置文件的名称。

--query-parameters

要包含或排除的查询参数(逗号分隔)。

--query-string-behavior

请求的查询字符串行为。

接受的值: Exclude, ExcludeAll, Include, IncludeAll
--redirect-protocol

要用于重定向的协议。

接受的值: Http, Https, MatchRequest
--redirect-type

重定向流量时规则将使用的重定向类型。

接受的值: Found, Moved, PermanentRedirect, TemporaryRedirect
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--rule-name

规则的名称,仅适用于 Microsoft SKU。

--selector

匹配条件的选择器。

--source-pattern

一种请求 URI 模式,用于标识可能重写的请求类型。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--transform

转换以在匹配之前应用。

接受的值: Lowercase, Uppercase
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az cdn endpoint rule remove

预览

命令组“cdn 终结点规则”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

从终结点中删除传递规则。

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

示例

删除全局规则。

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

删除顺序为 4 的规则。

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

可选参数

--ids

一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name -n

CDN 终结点的名称。

--order

为终结点应用规则的顺序。 可能的值 {0,1,2,3,.........}。 将应用顺序较低的规则,然后再应用一个具有较高顺序的规则。 具有顺序 0 的规则是一个特殊规则。 它不需要任何条件,并且它中列出的操作将始终应用。

--profile-name

资源组中唯一的 CDN 配置文件的名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--rule-name

规则名称。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az cdn endpoint rule show

预览

命令组“cdn 终结点规则”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

显示与终结点关联的传递规则。

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

示例

显示与终结点关联的传递规则。

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

可选参数

--ids

一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name -n

CDN 终结点的名称。

--profile-name

资源组中唯一的 CDN 配置文件的名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。