az containerapp sessionpool

注意

此參考是 Azure CLI 容器應用程式延伸模組的一部分(2.62.0 版或更高版本)。 擴充功能會在您第一次執行 az containerapp sessionpool 命令時自動安裝。 深入了解擴充功能。

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

管理會話集區的命令。

命令

名稱 Description 類型 狀態
az containerapp sessionpool create

建立或更新會話集區。

副檔名 預覽​​
az containerapp sessionpool delete

刪除工作階段集區。

副檔名 預覽​​
az containerapp sessionpool list

依訂用帳戶或資源群組列出會話集區。

副檔名 預覽​​
az containerapp sessionpool show

顯示工作階段集區的詳細數據。

副檔名 預覽​​
az containerapp sessionpool update

更新會話集區。

副檔名 預覽​​

az containerapp sessionpool create

預覽

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

建立或更新會話集區。

az containerapp sessionpool create --name
                                   --resource-group
                                   [--args]
                                   [--command]
                                   [--container-name]
                                   [--container-type {CustomContainer, NodeLTS, PythonLTS}]
                                   [--cooldown-period]
                                   [--cpu]
                                   [--env-vars]
                                   [--environment]
                                   [--image]
                                   [--location]
                                   [--max-sessions]
                                   [--memory]
                                   [--network-status {EgressDisabled, EgressEnabled}]
                                   [--no-wait]
                                   [--ready-sessions]
                                   [--registry-password]
                                   [--registry-server]
                                   [--registry-username]
                                   [--secrets]
                                   [--target-port]

範例

使用容器類型 PythonLTS 預設設定建立或更新會話集區。

az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --location eastasia

使用容器類型 PythonLTS 建立或更新會話集區,最大並行會話為 30 個,就緒會話實例 20。

az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type PythonLTS --max-sessions 30 --ready-sessions 20 \
    --location eastasia

使用預設快速入門映像,使用容器類型 CustomContainer 建立或更新會話集區。

az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type CustomContainer --environment MyEnvironment \
    --cpu 0.5 --memory 1Gi --target-port 80 --location eastasia --image mcr.microsoft.com/k8se/quickstart:latest

使用具有秘密和環境變數的容器類型 CustomContainer 建立或更新會話集區。

az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type CustomContainer --environment MyEnvironment \
    --cpu 0.5 --memory 1Gi --target-port 80 --image MyImage \
    --env-vars GREETING="Hello, world" SECRETENV=secretref:anothersecret \
    --secrets mysecret=secretvalue1 anothersecret="secret value 2" --location eastasia

使用來自私人登錄的 CustomContainer 容器類型建立或更新會話集區

az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --container-type CustomContainer --environment MyEnvironment --image MyImage \
    --cpu 0.5 --memory 1Gi --target-port 80 --registry-server myregistry.azurecr.io \
    --registry-username myregistry --registry-password $REGISTRY_PASSWORD \
    --location eastasia

建立或更新容器類型為 CustomContainer 的會話集區,其冷卻期間為 360s

az containerapp sessionpool create -n mysessionpool -g MyResourceGroup \
    --environment MyEnvironment --cpu 0.5 --memory 1Gi --target-port 80 --container-type CustomContainer \
    --cooldown-period 360 --location eastasia

必要參數

--name -n

工作階段集區名稱。

--resource-group -g

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

選擇性參數

--args

容器啟動命令自變數的清單。 以空格分隔的值,例如 “-c” “mycommand”。 空字串可清除現有的值。

--command

在啟動期間執行之容器上支援的命令清單。 以空格分隔的值,例如 “/bin/queue” “mycommand”。 空字串可清除現有的值。

--container-name

容器的名稱。 如果未提供容器名稱,則建立時,容器名稱會預設為小寫所涵蓋的會話集區名稱。

--container-type

會話集區的集區類型,default='PythonLTS'。

接受的值: CustomContainer, NodeLTS, PythonLTS
--cooldown-period

期間 (以秒為單位),之後將會刪除會話,預設值=300。

--cpu

核心中所需的CPU,從0.25 - 2.0,例如0.5。

--env-vars

容器的環境變數清單。 以 『key=value』 格式分隔的空間值。 空字串可清除現有的值。 使用 'secretref:' 作為參考秘密的前置詞值。

--environment

容器應用程式環境的名稱或資源識別碼。

--image -i

容器映射,例如 publisher/image-name:tag。

--location -l

位置。​​ 值的來源:az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--max-sessions

會話計數上限可以同時執行。

--memory

0.5 - 4.0 的所需記憶體以 “Gi” 結尾,例如 1.0Gi。

--network-status

工作階段或未啟用輸出。

接受的值: EgressDisabled, EgressEnabled
--no-wait

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

預設值: False
--ready-sessions

一直會在會話集區中準備的會話數目。

--registry-password

登入容器登錄的密碼。 如果儲存為秘密,值必須以 'secretref:' 開頭,後面接著秘密名稱。

--registry-server

容器登錄伺服器主機名,例如 myregistry.azurecr.io。

--registry-username

要登入容器登錄的用戶名稱。

--secrets -s

會話集區的秘密清單。 以 『key=value』 格式分隔的空間值。 空字串可清除現有的值。

--target-port

用於輸入流量的工作階段連接埠。

全域參數
--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 containerapp sessionpool delete

預覽

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

刪除工作階段集區。

az containerapp sessionpool delete --resource-group
                                   [--ids]
                                   [--name]
                                   [--no-wait]
                                   [--subscription]
                                   [--yes]

範例

刪除工作階段集區。

az containerapp sessionpool delete -n mysessionpool -g MyResourceGroup

必要參數

--resource-group -g

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

選擇性參數

--ids

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

--name -n

工作階段集區名稱。

--no-wait

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

預設值: False
--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 containerapp sessionpool list

預覽

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

依訂用帳戶或資源群組列出會話集區。

az containerapp sessionpool list [--resource-group]

範例

列出目前訂用帳戶中的會話集區。

az containerapp sessionpool list

依資源群組列出會話集區。

az containerapp sessionpool list -g MyResourceGroup

選擇性參數

--resource-group -g

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

全域參數
--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 containerapp sessionpool show

預覽

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

顯示工作階段集區的詳細數據。

az containerapp sessionpool show --resource-group
                                 [--ids]
                                 [--name]
                                 [--subscription]

範例

顯示工作階段集區的詳細數據。

az containerapp sessionpool show -n mysessionpool -g MyResourceGroup

必要參數

--resource-group -g

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

選擇性參數

--ids

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

--name -n

工作階段集區名稱。

--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 containerapp sessionpool update

預覽

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

更新會話集區。

az containerapp sessionpool update --resource-group
                                   [--args]
                                   [--command]
                                   [--container-name]
                                   [--cooldown-period]
                                   [--cpu]
                                   [--env-vars]
                                   [--ids]
                                   [--image]
                                   [--location]
                                   [--max-sessions]
                                   [--memory]
                                   [--name]
                                   [--network-status {EgressDisabled, EgressEnabled}]
                                   [--no-wait]
                                   [--ready-sessions]
                                   [--registry-password]
                                   [--registry-server]
                                   [--registry-username]
                                   [--secrets]
                                   [--subscription]
                                   [--target-port]

範例

更新會話集區的最大並行會話組態和映像。

az containerapp sessionpool update -n mysessionpool -g MyResourceGroup --max-sessions 20 --image MyNewImage

必要參數

--resource-group -g

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

選擇性參數

--args

容器啟動命令自變數的清單。 以空格分隔的值,例如 “-c” “mycommand”。 空字串可清除現有的值。

--command

在啟動期間執行之容器上支援的命令清單。 以空格分隔的值,例如 “/bin/queue” “mycommand”。 空字串可清除現有的值。

--container-name

容器的名稱。 如果未提供容器名稱,則建立時,容器名稱會預設為小寫所涵蓋的會話集區名稱。

--cooldown-period

期間 (以秒為單位),之後將會刪除會話,預設值=300。

--cpu

核心中所需的CPU,從0.25 - 2.0,例如0.5。

--env-vars

容器的環境變數清單。 以 『key=value』 格式分隔的空間值。 空字串可清除現有的值。 使用 'secretref:' 作為參考秘密的前置詞值。

--ids

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

--image -i

容器映射,例如 publisher/image-name:tag。

--location -l

位置。​​ 值的來源:az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--max-sessions

會話計數上限可以同時執行。

--memory

0.5 - 4.0 的所需記憶體以 “Gi” 結尾,例如 1.0Gi。

--name -n

工作階段集區名稱。

--network-status

工作階段或未啟用輸出。

接受的值: EgressDisabled, EgressEnabled
--no-wait

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

預設值: False
--ready-sessions

一直會在會話集區中準備的會話數目。

--registry-password

登入容器登錄的密碼。 如果儲存為秘密,值必須以 'secretref:' 開頭,後面接著秘密名稱。

--registry-server

容器登錄伺服器主機名,例如 myregistry.azurecr.io。

--registry-username

要登入容器登錄的用戶名稱。

--secrets -s

會話集區的秘密清單。 以 『key=value』 格式分隔的空間值。 空字串可清除現有的值。

--subscription

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

--target-port

用於輸入流量的工作階段連接埠。

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