az afd route

命令群組 『afd』 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

管理 AFD 端點下的路由。

命令

名稱 Description 類型 狀態
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

要關聯之源群組的名稱或標識碼。

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

路由所參考之標識碼或規則集名稱的集合。 支援速記語法、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

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 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

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

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

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 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

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 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

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 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

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--name --route-name -n

路由規則的名稱。

--profile-name

Azure Front Door Standard 或 Azure Front Door 進階版 配置檔的名稱,此配置檔在資源群組中是唯一的。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 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

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 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

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--link-to-default-domain

此路由是否會連結至預設端點網域。

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

路由規則的名稱。

--no-wait

請勿等候長時間執行的作業完成。

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

要關聯之源群組的名稱或標識碼。

--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 屬性ToRemove。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--rule-sets

路由所參考之標識碼或規則集名稱的集合。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--set

指定要設定的屬性路徑和值,以更新物件。 範例:--set property1.property2=。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 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

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 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

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--interval

輪詢間隔以秒為單位。

預設值: 30
--name --route-name -n

路由規則的名稱。

--profile-name

Azure Front Door Standard 或 Azure Front Door 進階版 配置檔的名稱,此配置檔在資源群組中是唯一的。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 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

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。