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
You can try this:
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 theadd
parameter. Because the—add
parameter is used to modify values as well as increase or decreasesku
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
forpersitescaling
.As you have already tried this workaround, I tried a similar approach, and it worked as shown:
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.In addition to that, I tried to get the exact results using Azure
PowerShell
and it worked: