From f7133cb5e2af91ee2cd8673d86885cf292294cd9 Mon Sep 17 00:00:00 2001 From: RakeshMohan-MSFT <49954584+RakeshMohanMSFT@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:28:13 +0530 Subject: [PATCH] [App Service] Fix #23135: `az functionapp plan create`: Add validation for the valid value of `--number-of-workers` option (#23153) --- src/azure-cli/azure/cli/command_modules/appservice/custom.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/azure-cli/azure/cli/command_modules/appservice/custom.py b/src/azure-cli/azure/cli/command_modules/appservice/custom.py index 080b9c8818d..946565ea48e 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/custom.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/custom.py @@ -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,