Skip to content

Commit ef54889

Browse files
authored
[App Service] az webapp config set: Remove number of workers validation (#31443)
1 parent 08ad921 commit ef54889

File tree

1 file changed

+12
-3
lines changed
  • src/azure-cli/azure/cli/command_modules/appservice

1 file changed

+12
-3
lines changed

src/azure-cli/azure/cli/command_modules/appservice/custom.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,8 +2180,6 @@ def update_site_configs(cmd, resource_group_name, name, slot=None, number_of_wor
21802180
get_current_stack_from_runtime(runtime_version) != "tomcat" else "java"
21812181
_update_webapp_current_stack_property_if_needed(cmd, resource_group_name, name, current_stack)
21822182

2183-
if number_of_workers is not None:
2184-
number_of_workers = validate_range_of_int_flag('--number-of-workers', number_of_workers, min_val=0, max_val=20)
21852183
if linux_fx_version:
21862184
if linux_fx_version.strip().lower().startswith('docker|'):
21872185
if ('WEBSITES_ENABLE_APP_SERVICE_STORAGE' not in app_settings.properties or
@@ -2270,7 +2268,18 @@ def update_site_configs(cmd, resource_group_name, name, slot=None, number_of_wor
22702268
if max_replicas is not None:
22712269
setattr(configs, 'function_app_scale_limit', max_replicas)
22722270
return update_configuration_polling(cmd, resource_group_name, name, slot, configs)
2273-
return _generic_site_operation(cmd.cli_ctx, resource_group_name, name, 'update_configuration', slot, configs)
2271+
try:
2272+
return _generic_site_operation(cmd.cli_ctx, resource_group_name, name, 'update_configuration', slot, configs)
2273+
except Exception as ex: # pylint: disable=broad-exception-caught
2274+
error_message = str(ex)
2275+
if "Conflict" in error_message:
2276+
logger.error("Operation returned an invalid status 'Conflict'. "
2277+
"For more details, run the command with the --debug parameter.")
2278+
elif "Bad Request" in error_message:
2279+
logger.error("Operation returned an invalid status 'Bad Request'. "
2280+
"For more details, run the command with the --debug parameter.")
2281+
else:
2282+
raise
22742283

22752284

22762285
def update_configuration_polling(cmd, resource_group_name, name, slot, configs):

0 commit comments

Comments
 (0)