az appservice plan

Manage app service plans.

Commands

az appservice plan create

Create an app service plan.

az appservice plan delete

Delete an app service plan.

az appservice plan list

List app service plans.

az appservice plan show

Get the app service plans for a resource group or a set of resource groups.

az appservice plan update

Update an app service plan.

az appservice plan create

Create an app service plan.

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]

Examples

Create a basic app service plan.

az appservice plan create -g MyResourceGroup -n MyPlan

Create a standard app service plan with four Linux workers.

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

Create a Windows container app service plan.

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

Create an app service plan for app service environment.

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

Create an app service plan for app service environment in different subscription.

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

Create an app service plan for app service environment in different subscription and the resource group in different region than app service environment.

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

Required Parameters

--name -n

Name of the new app service plan.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--app-service-environment -e

Name or ID of the app service environment. If you want to create the app service plan in different subscription than the app service environment, please use the resource ID for --app-service-environment parameter.

--hyper-v

Host web app on Windows container.

--is-linux

Host web app on Linux worker.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--number-of-workers

Number of workers to be allocated.

default value: 1
--per-site-scaling

Enable per-app scaling at the App Service plan level to allow for scaling an app independently from the App Service plan that hosts it.

default value: False
--sku

The pricing tiers, e.g., F1(Free), D1(Shared), B1(Basic Small), B2(Basic Medium), B3(Basic Large), S1(Standard Small), P1V2(Premium V2 Small), P2V2(Premium V2 Medium), P3V2(Premium V2 Large), P0V3(Premium V3 Extra Small), P1V3(Premium V3 Small), P2V3(Premium V3 Medium), P3V3(Premium V3 Large), P1MV3(Premium Memory Optimized V3 Small), P2MV3(Premium Memory Optimized V3 Medium), P3MV3(Premium Memory Optimized V3 Large), P4MV3(Premium Memory Optimized V3 Extra Large), P5MV3(Premium Memory Optimized V3 Extra Extra Large), I1 (Isolated Small), I2 (Isolated Medium), I3 (Isolated Large), I1v2 (Isolated V2 Small), I2v2 (Isolated V2 Medium), I3v2 (Isolated V2 Large), I4v2 (Isolated V2 I4v2), I5v2 (Isolated V2 I5v2), I6v2 (Isolated V2 I6v2), WS1 (Logic Apps Workflow Standard 1), WS2 (Logic Apps Workflow Standard 2), WS3 (Logic Apps Workflow Standard 3).

accepted values: 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
default value: B1
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--zone-redundant -z

Enable zone redundancy for high availability. Cannot be changed after plan creation. Minimum instance count is 3.

default value: False

az appservice plan delete

Delete an app service plan.

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

Examples

Delete an app service plan. (autogenerated)

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

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The name of the app service plan.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--yes -y

Do not prompt for confirmation.

default value: False

az appservice plan list

List app service plans.

az appservice plan list [--resource-group]

Examples

List all free tier App Service plans.

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

List all App Service plans for an App Service environment.

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

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az appservice plan show

Get the app service plans for a resource group or a set of resource groups.

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

Examples

Get the app service plans for a resource group or a set of resource groups. (autogenerated)

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

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The name of the app service plan.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az appservice plan update

Update an app service plan.

See https:///go.microsoft.com/fwlink/?linkid=2133856 to learn more.

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]

Examples

Update an app service plan. (autogenerated)

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

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

default value: []
--elastic-scale

Enable or disable automatic scaling. Set to "true" to enable elastic scale for this plan, or "false" to disable elastic scale for this plan. The SKU must be a Premium V2 SKU (P1V2, P2V2, P3V2) or a Premium V3 SKU (P1V3, P2V3, P3V3).

accepted values: false, true
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

default value: False
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--max-elastic-worker-count -m

Maximum number of instances that the plan can scale out to. The plan must be an elastic scale plan.

--name -n

The name of the app service plan.

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--number-of-workers

Number of workers to be allocated.

default value: 1
--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

default value: []
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

default value: []
--sku

The pricing tiers, e.g., F1(Free), D1(Shared), B1(Basic Small), B2(Basic Medium), B3(Basic Large), S1(Standard Small), P1V2(Premium V2 Small), P2V2(Premium V2 Medium), P3V2(Premium V2 Large), P0V3(Premium V3 Extra Small), P1V3(Premium V3 Small), P2V3(Premium V3 Medium), P3V3(Premium V3 Large), P1MV3(Premium Memory Optimized V3 Small), P2MV3(Premium Memory Optimized V3 Medium), P3MV3(Premium Memory Optimized V3 Large), P4MV3(Premium Memory Optimized V3 Extra Large), P5MV3(Premium Memory Optimized V3 Extra Extra Large), I1 (Isolated Small), I2 (Isolated Medium), I3 (Isolated Large), I1v2 (Isolated V2 Small), I2v2 (Isolated V2 Medium), I3v2 (Isolated V2 Large), I4v2 (Isolated V2 I4v2), I5v2 (Isolated V2 I5v2), I6v2 (Isolated V2 I6v2), WS1 (Logic Apps Workflow Standard 1), WS2 (Logic Apps Workflow Standard 2), WS3 (Logic Apps Workflow Standard 3).

accepted values: 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

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.