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

az afd route

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

管理 AFD 终结点下的路由。

命令

名称 说明 类型 状态
az afd route create

在指定的订阅、资源组、配置文件和 AzureFrontDoor 终结点下创建具有指定路由名称的新路由。

核心 预览
az afd route delete

删除具有指定订阅、资源组、配置文件和 AzureFrontDoor 终结点下指定路由名称的现有路由。

核心 预览
az afd route list

列出配置文件中的所有现有源。

核心 预览版
az afd route show

获取具有指定订阅、资源组、配置文件和 AzureFrontDoor 终结点下指定路由名称的现有路由。

核心 预览版
az afd route update

使用指定订阅、资源组、配置文件和 AzureFrontDoor 终结点下的指定路由名称更新新路由。

核心 预览
az afd route wait

将 CLI 置于等待状态,直到满足条件。

核心 预览

az afd route create

预览

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

在指定的订阅、资源组、配置文件和 AzureFrontDoor 终结点下创建具有指定路由名称的新路由。

az afd route create --endpoint-name
                    --name
                    --profile-name
                    --resource-group
                    [--content-types-to-compress]
                    [--custom-domains]
                    [--enable-caching {0, 1, f, false, n, no, t, true, y, yes}]
                    [--enable-compression {0, 1, f, false, n, no, t, true, y, yes}]
                    [--enabled-state {Disabled, Enabled}]
                    [--forwarding-protocol {HttpOnly, HttpsOnly, MatchRequest}]
                    [--https-redirect {Disabled, Enabled}]
                    [--link-to-default-domain {Disabled, Enabled}]
                    [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                    [--origin-group]
                    [--origin-path]
                    [--patterns-to-match]
                    [--query-parameters]
                    [--query-string-caching-behavior]
                    [--rule-sets]
                    [--supported-protocols]

示例

创建一个路由,将终结点的默认域与所有 HTTPS 请求的源组相关联。

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

创建一个路由,将终结点的默认域与所有请求的源组相关联,并使用指定的规则集自定义路由行为。

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

创建一个路由,用于将终结点的默认域和自定义域与具有指定路径模式的所有请求的源组相关联,并将所有 trafic 重定向为使用 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

必需参数

--endpoint-name

全局唯一的配置文件下的终结点的名称。

--name --route-name -n

路由规则的名称。

--profile-name

Azure Front Door Standard 或 Azure Front Door 高级版配置文件的名称,该配置文件在资源组中是唯一的。

--resource-group -g

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

可选参数

--content-types-to-compress

要对其应用压缩的内容类型的列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--custom-domains

此终结点引用的自定义域。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--enable-caching

指示缓存是否在该路由上附加。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--enable-compression

指示是否在 AzureFrontDoor 上启用内容压缩。 默认值为 false。 如果启用了压缩,如果用户请求压缩版本,内容将作为压缩。请求的内容不会压缩到 AzureFrontDoorhen 请求的内容小于 1 字节或大于 1 MB。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--enabled-state

是否要启用此规则。 允许的值为“Enabled”或“Disabled”。

接受的值: Disabled, Enabled
--forwarding-protocol

将流量转发到后端时此规则将使用的协议。

接受的值: HttpOnly, HttpsOnly, MatchRequest
默认值: MatchRequest
--https-redirect

是否自动将 HTTP 流量重定向到 HTTPS 流量。 请注意,这是设置此规则的一种简单方法,这将是执行的第一个规则。

接受的值: Disabled, Enabled
默认值: Disabled
--link-to-default-domain

此路由是否链接到默认终结点域。

接受的值: Disabled, Enabled
默认值: Disabled
--no-wait

不等待长时间运行的操作完成。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--origin-group

要与之关联的源组的名称或 ID。

--origin-path

AzureFrontDoor 可用于从源检索内容的目录路径,例如 contoso.cloudapp.net/originpath。

--patterns-to-match

规则的路由模式。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--query-parameters

要包含或排除的查询参数。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--query-string-caching-behavior

定义 Frontdoor 如何缓存包含查询字符串的请求。缓存、忽略特定查询字符串、使用唯一 URL 缓存每个请求或缓存特定查询字符串时,可以忽略任何查询字符串。

--rule-sets

路由引用的规则集的 ID 或名称的集合。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--supported-protocols

此路由支持的协议列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

默认值: ['Http', 'Https']
全局参数
--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 afd route delete

预览

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

删除具有指定订阅、资源组、配置文件和 AzureFrontDoor 终结点下指定路由名称的现有路由。

az afd route delete [--endpoint-name]
                    [--ids]
                    [--name]
                    [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                    [--profile-name]
                    [--resource-group]
                    [--subscription]
                    [--yes]

示例

删除名为 route1 的路由。

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

可选参数

--endpoint-name

全局唯一的配置文件下的终结点的名称。

--ids

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

--name --route-name -n

路由规则的名称。

--no-wait

不等待长时间运行的操作完成。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--profile-name

Azure Front Door Standard 或 Azure Front Door 高级版配置文件的名称,该配置文件在资源组中是唯一的。

--resource-group -g

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

--subscription

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

--yes -y

不提示确认。

默认值: False
全局参数
--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 afd route list

预览

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

列出配置文件中的所有现有源。

az afd route list --endpoint-name
                  --profile-name
                  --resource-group
                  [--max-items]
                  [--next-token]

必需参数

--endpoint-name

全局唯一的配置文件下的终结点的名称。

--profile-name

Azure Front Door Standard 或 Azure Front Door 高级版配置文件的名称,该配置文件在资源组中是唯一的。

--resource-group -g

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

可选参数

--max-items

命令输出中要返回的项总数。 如果可用的项总数大于指定的值,则会在命令的输出中提供令牌。 若要恢复分页,请在后续命令的参数中 --next-token 提供令牌值。

--next-token

用于指定开始分页的位置的令牌。 这是先前截断的响应中的令牌值。

全局参数
--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 afd route show

预览

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

获取具有指定订阅、资源组、配置文件和 AzureFrontDoor 终结点下指定路由名称的现有路由。

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

可选参数

--endpoint-name

全局唯一的配置文件下的终结点的名称。

--ids

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

--name --route-name -n

路由规则的名称。

--profile-name

Azure Front Door Standard 或 Azure Front Door 高级版配置文件的名称,该配置文件在资源组中是唯一的。

--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 获取完整的调试日志。

az afd route update

预览

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

使用指定订阅、资源组、配置文件和 AzureFrontDoor 终结点下的指定路由名称更新新路由。

az afd route update [--add]
                    [--content-types-to-compress]
                    [--custom-domains]
                    [--enable-caching {0, 1, f, false, n, no, t, true, y, yes}]
                    [--enable-compression {0, 1, f, false, n, no, t, true, y, yes}]
                    [--enabled-state {Disabled, Enabled}]
                    [--endpoint-name]
                    [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                    [--forwarding-protocol {HttpOnly, HttpsOnly, MatchRequest}]
                    [--https-redirect {Disabled, Enabled}]
                    [--ids]
                    [--link-to-default-domain {Disabled, Enabled}]
                    [--name]
                    [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                    [--origin-group]
                    [--origin-path]
                    [--patterns-to-match]
                    [--profile-name]
                    [--query-parameters]
                    [--query-string-caching-behavior]
                    [--remove]
                    [--resource-group]
                    [--rule-sets]
                    [--set]
                    [--subscription]
                    [--supported-protocols]

示例

更新路由以接受 Http 和 Https 请求,并重定向所有 trafic 以使用 Https。

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

更新路由的规则集设置以自定义路由行为。

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

更新路由的压缩设置,为指定的内容类型启用压缩。

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

可选参数

--add

通过指定路径和键值对将对象添加到对象列表。 示例:--add property.listProperty <key=value、string 或 JSON 字符串>。

--content-types-to-compress

要对其应用压缩的内容类型的列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--custom-domains

此终结点引用的自定义域。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--enable-caching

指示缓存是否在该路由上附加。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--enable-compression

指示是否在 AzureFrontDoor 上启用内容压缩。 默认值为 false。如果启用了压缩,则如果用户请求压缩版本,内容将作为压缩。请求的内容不会压缩到 AzureFrontDoorhen 请求的内容小于 1 字节或大于 1 MB。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--enabled-state

是否要启用此规则。 允许的值为“Enabled”或“Disabled”。

接受的值: Disabled, Enabled
--endpoint-name

全局唯一的配置文件下的终结点的名称。

--force-string

使用“set”或“add”时,保留字符串文本,而不是尝试转换为 JSON。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--forwarding-protocol

将流量转发到后端时此规则将使用的协议。

接受的值: HttpOnly, HttpsOnly, MatchRequest
--https-redirect

是否自动将 HTTP 流量重定向到 HTTPS 流量。 请注意,这是设置此规则的一种简单方法,这将是执行的第一个规则。

接受的值: Disabled, Enabled
--ids

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

--link-to-default-domain

此路由是否链接到默认终结点域。

接受的值: Disabled, Enabled
--name --route-name -n

路由规则的名称。

--no-wait

不等待长时间运行的操作完成。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--origin-group

要与之关联的源组的名称或 ID。

--origin-path

AzureFrontDoor 可用于从源检索内容的目录路径,例如 contoso.cloudapp.net/originpath。

--patterns-to-match

规则的路由模式。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--profile-name

Azure Front Door Standard 或 Azure Front Door 高级版配置文件的名称,该配置文件在资源组中是唯一的。

--query-parameters

要包含或排除的查询参数。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--query-string-caching-behavior

定义 Frontdoor 如何缓存包含查询字符串的请求。缓存、忽略特定查询字符串、使用唯一 URL 缓存每个请求或缓存特定查询字符串时,可以忽略任何查询字符串。

--remove

从列表中删除属性或元素。 示例:--remove property.list OR --remove propertyToRemove。

--resource-group -g

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

--rule-sets

路由引用的规则集的 ID 或名称的集合。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--set

通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=。

--subscription

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

--supported-protocols

此路由支持的协议列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

全局参数
--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 afd route wait

预览

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

将 CLI 置于等待状态,直到满足条件。

az afd route wait [--created]
                  [--custom]
                  [--deleted]
                  [--endpoint-name]
                  [--exists]
                  [--ids]
                  [--interval]
                  [--name]
                  [--profile-name]
                  [--resource-group]
                  [--subscription]
                  [--timeout]
                  [--updated]

可选参数

--created

等待在“Succeeded”中使用“provisioningState”创建。

默认值: False
--custom

等待条件满足自定义 JMESPath 查询。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。

--deleted

等到删除为止。

默认值: False
--endpoint-name

全局唯一的配置文件下的终结点的名称。

--exists

等待资源存在。

默认值: False
--ids

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

--interval

轮询间隔(以秒为单位)。

默认值: 30
--name --route-name -n

路由规则的名称。

--profile-name

Azure Front Door Standard 或 Azure Front Door 高级版配置文件的名称,该配置文件在资源组中是唯一的。

--resource-group -g

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

--subscription

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

--timeout

最大等待(以秒为单位)。

默认值: 3600
--updated

等到 provisioningState 更新为“Succeeded”。

默认值: False
全局参数
--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 获取完整的调试日志。