Share via


az spring gateway

注意

此參考是 Azure CLI 的 Spring 延伸模組的一部分(2.56.0 版或更高版本)。 擴充功能會在您第一次執行 az spring gateway 命令時自動安裝。 深入了解擴充功能。

(僅限企業層)在 Azure Spring Apps 中管理閘道的命令。

命令

名稱 Description 類型 狀態
az spring gateway clear

清除閘道的所有設定。

副檔名 GA
az spring gateway create

建立 Spring Cloud Gateway。

副檔名 GA
az spring gateway custom-domain

用來管理閘道自定義網域的命令。

副檔名 GA
az spring gateway custom-domain bind

使用網關係結自定義網域。

副檔名 GA
az spring gateway custom-domain list

列出閘道的所有自訂網域。

副檔名 GA
az spring gateway custom-domain show

顯示自訂網域的詳細數據。

副檔名 GA
az spring gateway custom-domain unbind

解除系結閘道的自定義網域。

副檔名 GA
az spring gateway custom-domain update

更新閘道的自定義網域。

副檔名 GA
az spring gateway delete

刪除 Spring Cloud Gateway。

副檔名 GA
az spring gateway restart

重新啟動 Spring Cloud Gateway。

副檔名 GA
az spring gateway route-config

在 Azure Spring Apps 中管理閘道路由設定的命令。

副檔名 GA
az spring gateway route-config create

使用 Json 陣組格式的路由規則建立閘道路由設定。

副檔名 GA
az spring gateway route-config list

列出所有現有的閘道路由設定。

副檔名 GA
az spring gateway route-config remove

刪除現有的閘道路由設定。

副檔名 GA
az spring gateway route-config show

取得現有的閘道路由設定。

副檔名 GA
az spring gateway route-config update

使用 Json 陣組格式的路由規則更新現有的閘道路由設定。

副檔名 GA
az spring gateway show

顯示閘道的設定、布建狀態和運行時間狀態。

副檔名 GA
az spring gateway sync-cert

同步閘道憑證。

副檔名 GA
az spring gateway update

更新現有的閘道屬性。

副檔名 GA

az spring gateway clear

清除閘道的所有設定。

az spring gateway clear --resource-group
                        --service
                        [--no-wait]

必要參數

--resource-group -g

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

--service -s

Azure Spring Apps 實例的名稱,您可以使用 az configure --defaults spring=來設定預設服務。

選擇性參數

--no-wait

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

預設值: 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 spring gateway create

建立 Spring Cloud Gateway。

az spring gateway create --resource-group
                         --service
                         [--instance-count]

範例

建立 Spring Cloud Gateway。

az spring gateway create -s MyService -g MyResourceGroup --instance-count 2

必要參數

--resource-group -g

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

--service -s

Azure Spring Apps 實例的名稱,您可以使用 az configure --defaults spring=來設定預設服務。

選擇性參數

--instance-count

實例數目。

全域參數
--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 spring gateway delete

刪除 Spring Cloud Gateway。

az spring gateway delete --resource-group
                         --service
                         [--yes]

必要參數

--resource-group -g

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

--service -s

Azure Spring Apps 實例的名稱,您可以使用 az configure --defaults spring=來設定預設服務。

選擇性參數

--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 spring gateway restart

重新啟動 Spring Cloud Gateway。

az spring gateway restart --resource-group
                          --service
                          [--no-wait]
                          [--yes]

範例

重新啟動 Spring Cloud Gateway。

az spring gateway restart -s MyService -g MyResourceGroup

必要參數

--resource-group -g

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

--service -s

Azure Spring Apps 實例的名稱,您可以使用 az configure --defaults spring=來設定預設服務。

選擇性參數

--no-wait

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

預設值: False
--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 spring gateway show

顯示閘道的設定、布建狀態和運行時間狀態。

az spring gateway show --resource-group
                       --service

必要參數

--resource-group -g

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

--service -s

Azure Spring Apps 實例的名稱,您可以使用 az configure --defaults spring=來設定預設服務。

全域參數
--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 spring gateway sync-cert

同步閘道憑證。

az spring gateway sync-cert --resource-group
                            --service
                            [--no-wait]
                            [--yes]

範例

同步閘道憑證。

az spring gateway sync-cert -s MyService -g MyResourceGroup

必要參數

--resource-group -g

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

--service -s

Azure Spring Apps 實例的名稱,您可以使用 az configure --defaults spring=來設定預設服務。

選擇性參數

--no-wait

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

預設值: False
--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 spring gateway update

更新現有的閘道屬性。

az spring gateway update --resource-group
                         --service
                         [--addon-configs-file]
                         [--addon-configs-json]
                         [--allow-credentials {false, true}]
                         [--allow-origin-patterns]
                         [--allowed-headers]
                         [--allowed-methods]
                         [--allowed-origins]
                         [--api-description]
                         [--api-doc-location]
                         [--api-title]
                         [--api-version]
                         [--apm-types]
                         [--apms]
                         [--assign-endpoint {false, true}]
                         [--certificate-names]
                         [--client-id]
                         [--client-secret]
                         [--cpu]
                         [--enable-cert-verify {false, true}]
                         [--enable-response-cache {false, true}]
                         [--exposed-headers]
                         [--https-only {false, true}]
                         [--instance-count]
                         [--issuer-uri]
                         [--max-age]
                         [--memory]
                         [--no-wait]
                         [--properties]
                         [--response-cache-scope]
                         [--response-cache-size]
                         [--response-cache-ttl]
                         [--scope]
                         [--secrets]
                         [--server-url]

範例

更新閘道屬性。

az spring gateway update -s MyService -g MyResourceGroup --assign-endpoint true --https-only true

啟用並設定路由層級的回應快取,並將 ttl 設定為 5 分鐘。

az spring gateway update -s MyService -g MyResourceGroup --enable-response-cache --response-cache-scope Route --response-cache-ttl 5m

啟用回應快取時,請將ttl更新為3分鐘。

az spring gateway update -s MyService -g MyResourceGroup --response-cache-ttl 3m

停用回應快取。

az spring gateway update -s MyService -g MyResourceGroup --enable-response-cache false

必要參數

--resource-group -g

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

--service -s

Azure Spring Apps 實例的名稱,您可以使用 az configure --defaults spring=來設定預設服務。

選擇性參數

--addon-configs-file

附加元件元件組態 JSON 字串的檔案路徑。

--addon-configs-json

附加元件元件的 JSON 字串。

--allow-credentials

跨網站要求是否支援用戶認證。

接受的值: false, true
--allow-origin-patterns --allowed-origin-patterns

允許來源模式的逗號分隔清單,以提出跨網站要求。

--allowed-headers

跨網站要求中允許標頭的逗號分隔清單。 特殊值 * 可讓實際要求傳送任何標頭。

--allowed-methods

跨網站要求上允許的 HTTP 方法逗號分隔清單。 特殊值 * 允許所有方法。

--allowed-origins

允許來源的逗號分隔清單來進行跨網站要求。 特殊值 * 允許所有網域。

--api-description

閘道實例上可用 API 的詳細描述。

--api-doc-location

閘道實例上可用 API 的其他檔位置。

--api-title

描述閘道實例上可用 API 內容的標題。

--api-version

此閘道實例上可用的 API 版本。

--apm-types

與閘道整合的 APM 空間分隔清單。 允許的值為:ApplicationInsights、AppDynamics、Dynatrace、NewRelic、ElasticAPM。

--apms

Azure Spring Apps 中 APM 參考名稱的空間分隔清單,以與閘道整合。

--assign-endpoint

如果為 true,請指派端點 URL 以進行直接存取。

接受的值: false, true
--certificate-names

Azure Spring Apps 中憑證名稱的逗號分隔清單。

--client-id

應用程式的公用標識碼。

--client-secret

只有應用程式和授權伺服器才知道的秘密。

--cpu

CPU 資源數量。 應該是 500m 或 CPU 核心數目。

--enable-cert-verify --enable-certificate-verification

如果為 true,將會驗證 TLS 連線中的憑證,從閘道到應用程式。

接受的值: false, true
--enable-response-cache

在 Spring Cloud 閘道中啟用回應快取設定。

接受的值: false, true
--exposed-headers

要針對跨網站要求公開的 HTTP 回應標頭逗號分隔清單。

--https-only

如果為 true,請透過 HTTPs 存取端點。

接受的值: false, true
--instance-count

實例數目。

--issuer-uri

簽發者標識碼的 URI。

--max-age

用戶端可以快取來自正式發行前要求之回應多久,以秒為單位。

--memory

記憶體資源數量。 應該是 512Mi 或 #Gi,例如 1Gi、3Gi。

--no-wait

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

預設值: False
--properties

環境變數的非敏感性屬性。 格式化 “key[=value]” ,並以空格分隔。

--response-cache-scope

回應快取的範圍,可用的值為 [Route, Instance]。

--response-cache-size

決定快取是否需要收回某些專案的快取大小上限。 範例包括 [1GB、10MB、100KB]。 使用 「預設值」重設,閘道將會管理此屬性。

--response-cache-ttl

快取專案到期前的時間。 範例包括 [1h, 30m, 50s]。 使用 「預設值」重設,閘道將會管理此屬性。

--scope

您可以代表使用者執行特定動作應用程式的逗號分隔清單。

--secrets

環境變數的敏感性屬性。 一旦放置之後,它就會加密且不會傳回。格式化 “key[=value]” ,並以空格分隔。

--server-url

API 取用者將用來存取閘道實例上的 API 基底 URL。

全域參數
--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 來取得完整偵錯記錄。