az appservice plan

注意

此命令群組具有 Azure CLI 和至少一個擴充功能中定義的命令。 安裝每個擴充功能以受益於其擴充功能。 深入了解擴充功能。

管理 App Service 方案。

命令

名稱 Description 類型 狀態
az appservice plan create

建立應用程式服務方案。

核心 GA
az appservice plan create (appservice-kube 擴充功能)

建立應用程式服務方案。

副檔名 GA
az appservice plan delete

刪除 App Service 方案。

核心 GA
az appservice plan list

列出 App Service 方案。

核心 GA
az appservice plan list (appservice-kube 擴充功能)

列出 App Service 方案。

副檔名 GA
az appservice plan show

取得資源群組或一組資源群組的App Service 方案。

核心 GA
az appservice plan show (appservice-kube 擴充功能)

取得資源群組或一組資源群組的App Service 方案。

副檔名 GA
az appservice plan update

更新 App Service 方案。

核心 GA
az appservice plan update (appservice-kube 擴充功能)

更新 App Service 方案。 若要深入瞭解,請參閱 https://docs.microsoft.com/azure/app-service/app-service-plan-manage#move-an-app-to-another-app-service-plan

副檔名 GA

az appservice plan create

建立應用程式服務方案。

az appservice plan create --name
                          --resource-group
                          [--app-service-environment]
                          [--hyper-v]
                          [--is-linux]
                          [--location]
                          [--no-wait]
                          [--number-of-workers]
                          [--per-site-scaling]
                          [--sku {B1, B2, B3, D1, F1, FREE, I1, I1v2, I2, I2v2, I3, I3v2, I4v2, I5v2, I6v2, P0V3, P1MV3, P1V2, P1V3, P2MV3, P2V2, P2V3, P3MV3, P3V2, P3V3, P4MV3, P5MV3, S1, S2, S3, SHARED, WS1, WS2, WS3}]
                          [--tags]
                          [--zone-redundant]

範例

建立基本 App Service 方案。

az appservice plan create -g MyResourceGroup -n MyPlan

建立具有四個 Linux 背景工作角色的標準 App Service 方案。

az appservice plan create -g MyResourceGroup -n MyPlan --is-linux --number-of-workers 4 --sku S1

建立 Windows 容器 App Service 方案。

az appservice plan create -g MyResourceGroup -n MyPlan --hyper-v --sku P1V3

建立 App Service 環境的 App Service 方案。

az appservice plan create -g MyResourceGroup -n MyPlan --app-service-environment MyAppServiceEnvironment --sku I1

在不同的訂用帳戶中,為App Service環境建立App Service方案。

az appservice plan create -g MyResourceGroup -n MyPlan --app-service-environment '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/hostingEnvironments/test-ase' --sku I1V2

針對不同訂用帳戶中的 App Service 環境,以及與 App Service 環境不同的區域資源群組,建立 App Service 方案。

az appservice plan create -g MyResourceGroup -n MyPlan --app-service-environment '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/hostingEnvironments/test-ase' --sku I1V2 --location ase-region

必要參數

--name -n

新 App Service 方案的名稱。

--resource-group -g

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

選擇性參數

--app-service-environment -e

應用程式服務環境的名稱或標識碼。 如果您想要在與 App Service 環境不同的訂用帳戶中建立 App Service 方案,請使用 --app-service-environment 參數的資源識別符。

--hyper-v

在 Hyper-V 背景工作角色上裝載 Windows 容器 Web 應用程式。

--is-linux

在 Linux 背景工作角色上裝載 Web 應用程式。

--location -l

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

--no-wait

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

預設值: False
--number-of-workers

要配置的工作者數目。

預設值: 1
--per-site-scaling

在 App Service 方案層級啟用個別應用程式調整,以允許從裝載應用程式的 App Service 方案獨立調整應用程式。

預設值: False
--sku

定價層,例如 F1(免費)、D1(共用)、B1(基本小)、B2(基本中型)、B3(基本大)、S1(標準小)、P1V2(進階版 V2 小型)、P2V2(進階版 V2 中型)、P3V2(進階版 V2 大型)、P0V3(進階版 V3 特小)、P1V3(進階版 V3 小型)、P2V3(進階版 V3 中型)、P3V3(進階版 V3 大型)、P1MV3(進階版記憶體優化 V3 小型),P2MV3(進階版 記憶體優化 V3 中型),P3MV3(進階版 記憶體優化 V3 大型),P4MV3(進階版 記憶體優化 V3 超大型),P5MV3(進階版 記憶體優化 V3 超大型),I1 (隔離 小型)、I2(隔離中型)、I3(隔離大型)、I1v2(隔離 V2 小型)、I2v2(隔離 V2 中型)、I3v2(隔離 V2 大型)、I4v2(隔離 V2 I4v2)、I5v2 (隔離 V2 I5v2) I6v2 (隔離 V2 I6v2)、WS1 (Logic Apps 工作流程標準 1)、WS2 (Logic Apps 工作流程標準 2)、WS3 (Logic Apps 工作流程標準 3)。

接受的值: B1, B2, B3, D1, F1, FREE, I1, I1v2, I2, I2v2, I3, I3v2, I4v2, I5v2, I6v2, P0V3, P1MV3, P1V2, P1V3, P2MV3, P2V2, P2V3, P3MV3, P3V2, P3V3, P4MV3, P5MV3, S1, S2, S3, SHARED, WS1, WS2, WS3
預設值: B1
--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

--zone-redundant -z

啟用高可用性的區域備援。 在建立計劃之後無法變更。 實例計數下限為 3。

預設值: 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 appservice plan create (appservice-kube 擴充功能)

建立應用程式服務方案。

az appservice plan create --name
                          --resource-group
                          [--app-service-environment]
                          [--custom-location]
                          [--hyper-v]
                          [--is-linux]
                          [--location]
                          [--no-wait]
                          [--number-of-workers]
                          [--per-site-scaling]
                          [--sku]
                          [--tags]

範例

建立基本 App Service 方案。

az appservice plan create -g MyResourceGroup -n MyPlan

建立具有四個 Linux 背景工作角色的標準 App Service 方案。

az appservice plan create -g MyResourceGroup -n MyPlan \
    --is-linux --number-of-workers 4 --sku S1

建立 App Service 環境的 App Service 方案。

az appservice plan create -g MyResourceGroup -n MyPlan \
    --app-service-environment MyAppServiceEnvironment --sku I1

建立 Kubernetes 環境的 App Service 方案。

az appservice plan create -g MyResourceGroup -n MyPlan \
    --custom-location /subscriptions/sub_id/resourcegroups/group_name/providers/microsoft.extendedlocation/customlocations/custom_location_name \
    --per-site-scaling --is-linux --sku K1

在與自定義位置相同的資源群組中建立 kubernetes 環境 App Service 方案

az appservice plan create -g MyResourceGroup -n MyPlan \
    --custom-location custom_location_name \
    --per-site-scaling --is-linux --sku K1

必要參數

--name -n

新 App Service 方案的名稱。

--resource-group -g

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

選擇性參數

--app-service-environment -e

應用程式服務環境的名稱或標識碼。

--custom-location -c

自訂位置的名稱或識別碼。 針對方案的不同資源群組中的自定義位置使用標識碼。

--hyper-v
預覽

在 Windows 容器上裝載 Web 應用程式。

--is-linux

在 Linux 背景工作角色上裝載 Web 應用程式。

--location -l

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

--no-wait

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

預設值: False
--number-of-workers

要配置的工作者數目。

預設值: 1
--per-site-scaling

在 App Service 方案層級啟用個別應用程式調整,以允許從裝載應用程式的 App Service 方案獨立調整應用程式。

預設值: False
--sku

定價層,例如 F1(免費)、D1(共用)、B1(基本小)、B2(基本中型)、B3(基本大)、S1(標準小)、P1V2(進階版 V2 小型)、PC2(進階版 容器小型)、PC3(進階版 容器中型)、PC4 (進階版 容器大型)、I1(隔離小型)、I2(隔離中型)、I3(隔離大型)、I1v2(隔離 V2 小型)、I2v2(隔離 V2 中型)、I3v2(隔離 V2 大型)K1 (Kubernetes)。

--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

全域參數
--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 appservice plan delete

刪除 App Service 方案。

az appservice plan delete [--ids]
                          [--name]
                          [--resource-group]
                          [--subscription]
                          [--yes]

範例

刪除 App Service 方案。 ( 自動產生 )

az appservice plan delete --name MyAppServicePlan --resource-group MyResourceGroup

選擇性參數

--ids

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

--name -n

App Service 方案的名稱。

--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 appservice plan list

列出 App Service 方案。

az appservice plan list [--resource-group]

範例

列出所有免費層 App Service 方案。

az appservice plan list --query "[?sku.tier=='Free']"

列出 App Service 環境的所有 App Service 方案。

az appservice plan list --query "[?hostingEnvironmentProfile.name=='<ase-name>']"

選擇性參數

--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 appservice plan list (appservice-kube 擴充功能)

列出 App Service 方案。

az appservice plan list [--resource-group]

範例

列出所有免費層 App Service 方案。

az appservice plan list --query "[?sku.tier=='Free']"

列出 App Service 環境的所有 App Service 方案。

az appservice plan list --query "[?hostingEnvironmentProfile.name=='<ase-name>']"

選擇性參數

--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 appservice plan show

取得資源群組或一組資源群組的App Service 方案。

az appservice plan show [--ids]
                        [--name]
                        [--resource-group]
                        [--subscription]

範例

取得資源群組或一組資源群組的App Service 方案。 ( 自動產生 )

az appservice plan show --name MyAppServicePlan --resource-group MyResourceGroup

選擇性參數

--ids

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

--name -n

App Service 方案的名稱。

--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 appservice plan show (appservice-kube 擴充功能)

取得資源群組或一組資源群組的App Service 方案。

az appservice plan show [--ids]
                        [--name]
                        [--resource-group]
                        [--subscription]

範例

取得資源群組或一組資源群組的App Service 方案。 ( 自動產生 )

az appservice plan show --name MyAppServicePlan --resource-group MyResourceGroup

選擇性參數

--ids

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

--name -n

App Service 方案的名稱。

--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 appservice plan update

更新 App Service 方案。

若要深入瞭解,請參閱 https:///go.microsoft.com/fwlink/?linkid=2133856。

az appservice plan update [--add]
                          [--elastic-scale {false, true}]
                          [--force-string]
                          [--ids]
                          [--max-elastic-worker-count]
                          [--name]
                          [--no-wait]
                          [--number-of-workers]
                          [--remove]
                          [--resource-group]
                          [--set]
                          [--sku {B1, B2, B3, D1, F1, FREE, I1, I1v2, I2, I2v2, I3, I3v2, I4v2, I5v2, I6v2, P0V3, P1MV3, P1V2, P1V3, P2MV3, P2V2, P2V3, P3MV3, P3V2, P3V3, P4MV3, P5MV3, S1, S2, S3, SHARED, WS1, WS2, WS3}]
                          [--subscription]

範例

更新 App Service 方案。 ( 自動產生 )

az appservice plan update --name MyAppServicePlan --resource-group MyResourceGroup --sku F1

選擇性參數

--add

藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例:--add property.listProperty <key=value, string or JSON string>

預設值: []
--elastic-scale
預覽

啟用或停用自動調整。 設定為 「true」 以啟用此方案的彈性調整,或 [false] 以停用此方案的彈性調整。 SKU 必須是 進階版 V2 SKU(P1V2、P2V2、P3V2)或 進階版 V3 SKU(P1V3、P2V3、P3V3)。

接受的值: false, true
--force-string

使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。

預設值: False
--ids

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

--max-elastic-worker-count -m
預覽

計劃可相應放大的實例數目上限。 方案必須是彈性調整計劃。

--name -n

App Service 方案的名稱。

--no-wait

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

預設值: False
--number-of-workers

要配置的工作者數目。

預設值: 1
--remove

從清單中移除屬性或專案。 範例: --remove property.list <indexToRemove>--remove propertyToRemove

預設值: []
--resource-group -g

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

--set

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

預設值: []
--sku

定價層,例如 F1(免費)、D1(共用)、B1(基本小)、B2(基本中型)、B3(基本大)、S1(標準小)、P1V2(進階版 V2 小型)、P2V2(進階版 V2 中型)、P3V2(進階版 進階版 V2 大型)、P0V3(進階版 V3 特小)、P1V3(進階版 V3 小型)、P2V3(進階版 V3 中型)、P3V3(進階版 V3 大型)、P1MV3(進階版記憶體優化 V3 小型)、P2MV3(進階版 記憶體優化 V3 中型)、P3MV3(進階版 記憶體優化 V3 大型)、P4MV3(進階版 記憶體優化 V3 超大型)、P5MV3(進階版 記憶體優化 V3 超大型)、I1 (隔離小型)、I2(隔離中型)、I3(隔離大型)、I1v2(隔離 V2 小型)、I2v2(隔離 V2 中型)、I3v2(隔離 V2 大型)、I4v2(隔離 V2 I4v2)、I5v2 (隔離 V2 I5v2) I6v2 (隔離 V2 I6v2)、WS1 (Logic Apps 工作流程標準 1)、WS2 (Logic Apps 工作流程標準 2)、WS3 (Logic Apps 工作流程標準 3)。

接受的值: B1, B2, B3, D1, F1, FREE, I1, I1v2, I2, I2v2, I3, I3v2, I4v2, I5v2, I6v2, P0V3, P1MV3, P1V2, P1V3, P2MV3, P2V2, P2V3, P3MV3, P3V2, P3V3, P4MV3, P5MV3, S1, S2, S3, SHARED, WS1, WS2, WS3
--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 appservice plan update (appservice-kube 擴充功能)

az appservice plan update [--ids]
                          [--name]
                          [--no-wait]
                          [--number-of-workers]
                          [--resource-group]
                          [--sku {ANY, B1, B2, B3, D1, ELASTICANY, F1, FREE, I1, I2, I3, P1V2, P2V2, P3V2, PC2, PC3, PC4, S1, S2, S3, SHARED}]
                          [--subscription]

範例

更新 App Service 方案。 ( 自動產生 )

az appservice plan update --name MyAppServicePlan --resource-group MyResourceGroup --sku F1

更新 kubernetes App Service 方案。

az appservice plan update --name MyAppServicePlan --resource-group MyResourceGroup \
    --sku ANY --number-of-workers 3

選擇性參數

--ids

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

--name -n

App Service 方案的名稱。

--no-wait

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

預設值: False
--number-of-workers

要配置的工作者數目。

預設值: 1
--resource-group -g

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

--sku

定價層,例如 F1(免費)、D1(共用)、B1(基本小)、B2(基本中型)、B3(基本大)、S1(標準小)、P1V2(進階版 V2 小型)、PC2(進階版 容器小型)、PC3(進階版 容器中型)、PC4(進階版 容器大型)、I1(隔離小型)、I2(隔離中型)、I3(隔離大)、K1(Kubernetes)。

接受的值: ANY, B1, B2, B3, D1, ELASTICANY, F1, FREE, I1, I2, I3, P1V2, P2V2, P3V2, PC2, PC3, PC4, S1, S2, S3, SHARED
--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 來取得完整偵錯記錄。