Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 38 additions & 42 deletions src/azure-cli/azure/cli/command_modules/appservice/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@
- name: Create a Windows container app service plan.
text: >
az appservice plan create -g MyResourceGroup -n MyPlan --hyper-v --sku P1V3
- name: Create an app service plan for app service environment.
- name: Create an app service plan for App Service Environment.
text: >
az appservice plan create -g MyResourceGroup -n MyPlan --app-service-environment MyAppServiceEnvironment --sku I1
- name: Create an app service plan for app service environment in different subscription.
az appservice plan create -g MyResourceGroup -n MyPlan --app-service-environment MyAppServiceEnvironment --sku I1v2
- name: Create an app service plan for App Service Environment in different subscription.
text: >
az appservice plan create -g MyResourceGroup -n MyPlan --app-service-environment '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/hostingEnvironments/test-ase' --sku I1V2
- name: Create an app service plan for app service environment in different subscription and the resource group in different region than app service environment.
- name: Create an app service plan for App Service Environment in different subscription and the resource group in different region than App Service Environment.
text: >
az appservice plan create -g MyResourceGroup -n MyPlan --app-service-environment '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/hostingEnvironments/test-ase' --sku I1V2 --location ase-region
"""
Expand Down Expand Up @@ -2521,66 +2521,66 @@

helps['appservice ase list'] = """
type: command
short-summary: List app service environments.
short-summary: List App Service Environments.
examples:
- name: List all app service environments in subscription.
- name: List all App Service Environments in subscription.
text: az appservice ase list
- name: List all app service environment in resource group.
- name: List all App Service Environment in resource group.
text: az appservice ase list --resource-group MyResourceGroup
"""

helps['appservice ase show'] = """
type: command
short-summary: Show details of an app service environment.
short-summary: Show details of an App Service Environment.
examples:
- name: Show app service environment.
- name: Show App Service Environment.
text: az appservice ase show --name MyAseName
"""

helps['appservice ase list-addresses'] = """
type: command
short-summary: List VIPs associated with an app service environment v2.
short-summary: List IP addresses associated with an App Service Environment.
examples:
- name: List VIPs for an app service environments.
- name: List IPs for an App Service Environment.
text: az appservice ase list-addresses --name MyAseName
"""

helps['appservice ase list-plans'] = """
type: command
short-summary: List app service plans associated with an app service environment.
short-summary: List app service plans associated with an App Service Environment.
examples:
- name: List app service plans for an app service environments.
- name: List app service plans for an App Service Environments.
text: az appservice ase list-plans --name MyAseName
"""

helps['appservice ase create'] = """
type: command
short-summary: Create app service environment.
short-summary: Create App Service Environment.
examples:
- name: Create resource group, Virtual Network and App Service Environment v3 with default values.
- name: Create resource group, Virtual Network and App Service Environment with default values.
text: |
az group create -g MyResourceGroup --location westeurope

az network vnet create -g MyResourceGroup -n MyVirtualNetwork \\
--address-prefixes 10.0.0.0/16 --subnet-name MyAseSubnet --subnet-prefixes 10.0.0.0/24

az appservice ase create -n MyAseName -g MyResourceGroup --vnet-name MyVirtualNetwork \\
--subnet MyAseSubnet --kind asev3
- name: Create external App Service Environments v3 in existing resource group and Virtual Network.
--subnet MyAseSubnet
- name: Create external App Service Environments in existing resource group and Virtual Network.
text: |
az appservice ase create -n MyAseName -g MyResourceGroup --vnet-name MyVirtualNetwork \\
--subnet MyAseSubnet --virtual-ip-type External --kind asev3
- name: Create Virtual Network and App Service Environment v3 in a smaller than recommended subnet in existing resource group.
--subnet MyAseSubnet --virtual-ip-type External
- name: Create Virtual Network and App Service Environment in a smaller than recommended subnet in existing resource group.
text: |
az network vnet create -g MyResourceGroup -n MyVirtualNetwork \\
--address-prefixes 10.0.0.0/16 --subnet-name MyAseSubnet --subnet-prefixes 10.0.0.0/26

az appservice ase create -n MyAseName -g MyResourceGroup --vnet-name MyVirtualNetwork \\
--subnet MyAseSubnet --ignore-subnet-size-validation --kind asev3
- name: Create external zone redundant App Service Environment v3 with default values.
--subnet MyAseSubnet --ignore-subnet-size-validation
- name: Create external zone redundant App Service Environment with default values.
text: |
az appservice ase create -n MyASEv3Name -g ASEv3ResourceGroup \\
--vnet-name MyASEv3VirtualNetwork --subnet MyASEv3Subnet --kind asev3 \\
az appservice ase create -n MyASEName -g ASEResourceGroup \\
--vnet-name MyASEVirtualNetwork --subnet MyASESubnet \\
--zone-redundant --virtual-ip-type External
"""

Expand All @@ -2596,46 +2596,42 @@

helps['appservice ase upgrade'] = """
type: command
short-summary: Upgrade app service environment v3.
short-summary: Upgrade App Service Environment.
examples:
- name: Upgrade app service environment v3.
- name: Upgrade App Service Environment.
text: |
az appservice ase upgrade -n MyAseV3Name -g MyResourceGroup
az appservice ase upgrade -n MyAseName -g MyResourceGroup
"""

helps['appservice ase send-test-notification'] = """
type: command
short-summary: Send a test upgrade notification in app service environment v3.
short-summary: Send a test upgrade notification in App Service Environment.
examples:
- name: Send a test upgrade notification in app service environment v3.
- name: Send a test upgrade notification in App Service Environment.
text: |
az appservice ase send-test-notification -n MyAseV3Name -g MyResourceGroup
az appservice ase send-test-notification -n MyAseName -g MyResourceGroup
"""

helps['appservice ase update'] = """
type: command
short-summary: Update app service environment.
short-summary: Update App Service Environment.
examples:
- name: Update app service environment v2 with medium front-ends and scale factor of 10.
- name: Update App Service Environment to allow new private endpoint connections.
text: |
az appservice ase update -n MyAseV2Name -g MyResourceGroup --front-end-sku I2 \\
--front-end-scale-factor 10
- name: Update app service environment v3 to allow new private endpoint connections.
az appservice ase update -n MyAseName -g MyResourceGroup --allow-new-private-endpoint-connections
- name: Update App Service Environment to allow incoming ftp connections.
text: |
az appservice ase update -n MyAseV3Name -g MyResourceGroup --allow-new-private-endpoint-connections
- name: Update app service environment v3 to allow incoming ftp connections.
az appservice ase update -n MyAseName -g MyResourceGroup --allow-incoming-ftp-connections
- name: Update App Service Environment to allow remote debugging.
text: |
az appservice ase update -n MyAseV3Name -g MyResourceGroup --allow-incoming-ftp-connections
- name: Update app service environment v3 to allow remote debugging.
text: |
az appservice ase update -n MyAseV3Name -g MyResourceGroup --allow-remote-debugging
az appservice ase update -n MyAseName -g MyResourceGroup --allow-remote-debugging
"""

helps['appservice ase delete'] = """
type: command
short-summary: Delete app service environment.
short-summary: Delete App Service Environment.
examples:
- name: Delete app service environment.
- name: Delete App Service Environment.
text: az appservice ase delete -n MyAseName
"""

Expand Down
32 changes: 5 additions & 27 deletions src/azure-cli/azure/cli/command_modules/appservice/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
DEPLOYMENT_STORAGE_AUTH_TYPES)

from ._validators import (validate_timeout_value, validate_site_create, validate_asp_create,
validate_front_end_scale_factor, validate_ase_create, validate_ip_address,
validate_ase_create, validate_ip_address,
validate_service_tag, validate_public_cloud)

AUTH_TYPES = {
Expand All @@ -35,8 +35,7 @@
OS_TYPES = ['Windows', 'Linux']
ACCESS_RESTRICTION_ACTION_TYPES = ['Allow', 'Deny']
ASE_LOADBALANCER_MODES = ['Internal', 'External']
ASE_KINDS = ['ASEv2', 'ASEv3']
ASE_OS_PREFERENCE_TYPES = ['Windows', 'Linux']
ASE_KINDS = ['ASEv3']
PUBLIC_NETWORK_ACCESS_MODES = ['Enabled', 'Disabled']
BASIC_AUTH_TYPES = ['Enabled', 'Disabled']
DAPR_LOG_LEVELS = ['debug', 'error', 'info', 'warn']
Expand All @@ -50,9 +49,9 @@ def load_arguments(self, _):
# PARAMETER REGISTRATION
name_arg_type = CLIArgumentType(options_list=['--name', '-n'], metavar='NAME')
sku_arg_type = CLIArgumentType(
help='The pricing tiers, e.g., F1(Free), D1(Shared), B1(Basic Small), B2(Basic Medium), B3(Basic Large), S1(Standard Small), P1V2(Premium V2 Small), P2V2(Premium V2 Medium), P3V2(Premium V2 Large), P0V3(Premium V3 Extra Small), P1V3(Premium V3 Small), P2V3(Premium V3 Medium), P3V3(Premium V3 Large), P1MV3(Premium Memory Optimized V3 Small), P2MV3(Premium Memory Optimized V3 Medium), P3MV3(Premium Memory Optimized V3 Large), P4MV3(Premium Memory Optimized V3 Extra Large), P5MV3(Premium Memory Optimized V3 Extra Extra Large), P0V4(Premium V4 Extra Small), P1V4(Premium V4 Small), P2V4(Premium V4 Medium), P3V4(Premium V4 Large), P1MV4(Premium Memory Optimized V4 Small), P2MV4(Premium Memory Optimized V4 Medium), P3MV4(Premium Memory Optimized V4 Large), P4MV4(Premium Memory Optimized V4 Extra Large), P5MV4(Premium Memory Optimized V4 Extra Extra Large), I1 (Isolated Small), I2 (Isolated Medium), I3 (Isolated Large), I1V2 (Isolated V2 I1V2), I2V2 (Isolated V2 I2V2), I3V2 (Isolated V2 I3V2), I4V2 (Isolated V2 I4V2), I5V2 (Isolated V2 I5V2), I6V2 (Isolated V2 I6V2), I1MV2 (Isolated Memory Optimized V2 I1MV2), I2MV2 (Isolated Memory Optimized V2 I2MV2), I3MV2 (Isolated Memory Optimized V2 I3MV2), I4MV2 (Isolated Memory Optimized V2 I4MV2), I5MV2 (Isolated Memory Optimized V2 I5MV2), WS1 (Logic Apps Workflow Standard 1), WS2 (Logic Apps Workflow Standard 2), WS3 (Logic Apps Workflow Standard 3)',
help='The pricing tiers, e.g., F1(Free), D1(Shared), B1(Basic Small), B2(Basic Medium), B3(Basic Large), S1(Standard Small), P1V2(Premium V2 Small), P2V2(Premium V2 Medium), P3V2(Premium V2 Large), P0V3(Premium V3 Extra Small), P1V3(Premium V3 Small), P2V3(Premium V3 Medium), P3V3(Premium V3 Large), P1MV3(Premium Memory Optimized V3 Small), P2MV3(Premium Memory Optimized V3 Medium), P3MV3(Premium Memory Optimized V3 Large), P4MV3(Premium Memory Optimized V3 Extra Large), P5MV3(Premium Memory Optimized V3 Extra Extra Large), P0V4(Premium V4 Extra Small), P1V4(Premium V4 Small), P2V4(Premium V4 Medium), P3V4(Premium V4 Large), P1MV4(Premium Memory Optimized V4 Small), P2MV4(Premium Memory Optimized V4 Medium), P3MV4(Premium Memory Optimized V4 Large), P4MV4(Premium Memory Optimized V4 Extra Large), P5MV4(Premium Memory Optimized V4 Extra Extra Large), I1V2 (Isolated V2 I1V2), I2V2 (Isolated V2 I2V2), I3V2 (Isolated V2 I3V2), I4V2 (Isolated V2 I4V2), I5V2 (Isolated V2 I5V2), I6V2 (Isolated V2 I6V2), I1MV2 (Isolated Memory Optimized V2 I1MV2), I2MV2 (Isolated Memory Optimized V2 I2MV2), I3MV2 (Isolated Memory Optimized V2 I3MV2), I4MV2 (Isolated Memory Optimized V2 I4MV2), I5MV2 (Isolated Memory Optimized V2 I5MV2), WS1 (Logic Apps Workflow Standard 1), WS2 (Logic Apps Workflow Standard 2), WS3 (Logic Apps Workflow Standard 3)',
arg_type=get_enum_type(
['F1', 'FREE', 'D1', 'SHARED', 'B1', 'B2', 'B3', 'S1', 'S2', 'S3', 'P1V2', 'P2V2', 'P3V2', 'P0V3', 'P1V3', 'P2V3', 'P3V3', 'P1MV3', 'P2MV3', 'P3MV3', 'P4MV3', 'P5MV3', 'P0V4', 'P1V4', 'P2V4', 'P3V4', 'P1MV4', 'P2MV4', 'P3MV4', 'P4MV4', 'P5MV4', 'I1', 'I2', 'I3', 'I1V2', 'I2V2', 'I3V2', 'I4V2', 'I5V2', 'I6V2', 'I1MV2', 'I2MV2', 'I3MV2', 'I4MV2', 'I5MV2', 'WS1', 'WS2', 'WS3']))
['F1', 'FREE', 'D1', 'SHARED', 'B1', 'B2', 'B3', 'S1', 'S2', 'S3', 'P1V2', 'P2V2', 'P3V2', 'P0V3', 'P1V3', 'P2V3', 'P3V3', 'P1MV3', 'P2MV3', 'P3MV3', 'P4MV3', 'P5MV3', 'P0V4', 'P1V4', 'P2V4', 'P3V4', 'P1MV4', 'P2MV4', 'P3MV4', 'P4MV4', 'P5MV4', 'I1V2', 'I2V2', 'I3V2', 'I4V2', 'I5V2', 'I6V2', 'I1MV2', 'I2MV2', 'I3MV2', 'I4MV2', 'I5MV2', 'WS1', 'WS2', 'WS3']))
webapp_name_arg_type = CLIArgumentType(configured_default='web', options_list=['--name', '-n'], metavar='NAME',
completer=get_resource_name_completion_list('Microsoft.Web/sites'),
id_part='name',
Expand All @@ -72,9 +71,6 @@ def load_arguments(self, _):
'functionapp': functionapp_name_arg_type,
'logicapp': logicapp_name_arg_type
}
isolated_sku_arg_type = CLIArgumentType(
help='The Isolated pricing tiers, e.g., I1 (Isolated Small), I2 (Isolated Medium), I3 (Isolated Large)',
arg_type=get_enum_type(['I1', 'I2', 'I3']))

static_web_app_sku_arg_type = CLIArgumentType(
help='The pricing tiers for Static Web App',
Expand Down Expand Up @@ -1181,22 +1177,8 @@ def load_arguments(self, _):
help="Specify if app service environment should be accessible from internet")
c.argument('ignore_subnet_size_validation', arg_type=get_three_state_flag(),
help='Do not check if subnet is sized according to recommendations.')
c.argument('ignore_route_table', arg_type=get_three_state_flag(),
help='Configure route table manually. Applies to ASEv2 only.')
c.argument('ignore_network_security_group', arg_type=get_three_state_flag(),
help='Configure network security group manually. Applies to ASEv2 only.')
c.argument('force_route_table', arg_type=get_three_state_flag(),
help='Override route table for subnet. Applies to ASEv2 only.')
c.argument('force_network_security_group', arg_type=get_three_state_flag(),
help='Override network security group for subnet. Applies to ASEv2 only.')
c.argument('front_end_scale_factor', type=int, validator=validate_front_end_scale_factor,
help='Scale of front ends to app service plan instance ratio. Applies to ASEv2 only.', default=15)
c.argument('front_end_sku', arg_type=isolated_sku_arg_type, default='I1',
help='Size of front end servers. Applies to ASEv2 only.')
c.argument('os_preference', arg_type=get_enum_type(ASE_OS_PREFERENCE_TYPES),
help='Determine if app service environment should start with Linux workers. Applies to ASEv2 only.')
c.argument('zone_redundant', arg_type=get_three_state_flag(),
help='Configure App Service Environment as Zone Redundant. Applies to ASEv3 only.')
help='Configure App Service Environment as Zone Redundant.')
with self.argument_context('appservice ase delete') as c:
c.argument('name', options_list=['--name', '-n'], help='Name of the app service environment')
with self.argument_context('appservice ase upgrade') as c:
Expand All @@ -1206,10 +1188,6 @@ def load_arguments(self, _):
with self.argument_context('appservice ase update') as c:
c.argument('name', options_list=['--name', '-n'], help='Name of the app service environment',
local_context_attribute=LocalContextAttribute(name='ase_name', actions=[LocalContextAction.GET]))
c.argument('front_end_scale_factor', type=int, validator=validate_front_end_scale_factor,
help='(ASEv2 only) Scale of front ends to app service plan instance ratio between 5 and 15.')
c.argument('front_end_sku', arg_type=isolated_sku_arg_type,
help='(ASEv2 only) Size of front end servers.')
c.argument('allow_new_private_endpoint_connections', arg_type=get_three_state_flag(),
options_list=['--allow-new-private-endpoint-connections', '-p'],
help='(ASEv3 only) Configure Apps in App Service Environment to allow new private endpoint connections.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,6 @@ def validate_add_vnet(cmd, namespace):
"Web app location: {}. Vnet location: {}".format(webapp_loc, vnet_loc))


def validate_front_end_scale_factor(namespace):
if namespace.front_end_scale_factor:
min_scale_factor = 5
max_scale_factor = 15
scale_error_text = "Frontend Scale Factor '{}' is invalid. Must be between {} and {}"
scale_factor = namespace.front_end_scale_factor
if scale_factor < min_scale_factor or scale_factor > max_scale_factor:
raise ValidationError(scale_error_text.format(scale_factor, min_scale_factor, max_scale_factor))


def validate_ip_address(cmd, namespace):
if namespace.ip_address is not None:
_validate_ip_address_format(namespace)
Expand Down
Loading
Loading