skip to Main Content

I don’t get it how to pass a key=value to the --add parameter of the az appservice plan update --id --add command.
I’d like to run this azure cli command:

az appservice plan update --id $plan --add "perSiteScaling=true"

However this throws an error:

ERROR: Couldn't find 'perSiteScaling=true' in ''. Available options: ['elasticScaleEnabled', 'extendedLocation', 'freeOfferExpirationTime', 'geoRegion', 'hostingEnvironmentProfile', 'hyperV', 'id', 'isSpot', 'isXenon', 'kind', 'kubeEnvironmentProfile', 'location', 'maximumElasticWorkerCount', 'maximumNumberOfWorkers', 'name', 'numberOfSites', 'numberOfWorkers', 'perSiteScaling', 'provisioningState', 'reserved', 'resourceGroup', 'sku', 'spotExpirationTime', 'status', 'subscription', 'tags', 'targetWorkerCount', 'targetWorkerSizeId', 'type', 'workerTierName', 'zoneRedundant']

The docs for the command are here: https://learn.microsoft.com/en-us/cli/azure/appservice/plan?view=azure-cli-latest#az-appservice-plan-update

The docs state about the optional –add parameter:

--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: []

2

Answers


  1. You can try this:

    az appservice plan update --id $plan --add perSiteScaling true
    
    Login or Signup to reply.
  2. Initially, according to the MsDoc there is no direct parameter existed for scaling up an app service plan. (perSiteScaling).

    If you want to enable persitescaling for an App Service, use the —set parameter rather than the add parameter. Because the —add parameter is used to modify values as well as increase or decrease sku capacities for a specific list of objects.

    However, persitescaling is a feature that can be enabled or disabled for an app service. As a result, you need to use —set for persitescaling.

    As you have already tried this workaround, I tried a similar approach, and it worked as shown:

    az appservice plan update --name MyPlan --resource-group <resourcegroup> --sku P2V2 --set perSiteScaling=true
    

    enter image description here

    Having followed the above workaround, I found another concept-based alternative:

    Typically, the only reason for scaling up an app service is to increase the number of workers. As a result, if you increase it as shown below, you can scale up the app service plan as needed.

    az appservice plan update --name MyPlan --resource-group <resourcegroup> --sku P2V2 --number-of-workers 3
    

    enter image description here

    In addition to that, I tried to get the exact results using Azure PowerShell and it worked:

    Set-AzAppServicePlan -ResourceGroupName <ResourceGroup> -Name "myplan" -PerSiteScaling $true
    

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search