Skip to content

Commit

Permalink
[App Service] Fix #23135: az functionapp plan create: Add validatio…
Browse files Browse the repository at this point in the history
…n for the valid value of `--number-of-workers` option (#23153)
  • Loading branch information
RakeshMohanMSFT authored Jul 11, 2022
1 parent ecfbedb commit f7133cb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/azure-cli/azure/cli/command_modules/appservice/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3379,6 +3379,8 @@ def create_functionapp_app_service_plan(cmd, resource_group_name, name, is_linux
client = web_client_factory(cmd.cli_ctx)
if location is None:
location = _get_location_from_resource_group(cmd.cli_ctx, resource_group_name)
if number_of_workers is not None:
number_of_workers = validate_range_of_int_flag('--number-of-workers', number_of_workers, min_val=0, max_val=20)
sku_def = SkuDescription(tier=tier, name=sku, capacity=number_of_workers)
plan_def = AppServicePlan(location=location, tags=tags, sku=sku_def,
reserved=(is_linux or None), maximum_elastic_worker_count=max_burst,
Expand Down

0 comments on commit f7133cb

Please sign in to comment.