Skip to content
Merged
31 changes: 27 additions & 4 deletions src/azure-cli/azure/cli/command_modules/appservice/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -2148,7 +2148,7 @@
type: command
short-summary: Create app service environment.
examples:
- name: Create Resource Group, vNet and app service environment with default values.
- name: Create Resource Group, vNet and app service environment v2 with default values.
text: |
az group create -g MyResourceGroup --location westeurope

Expand All @@ -2157,27 +2157,50 @@

az appservice ase create -n MyAseName -g MyResourceGroup --vnet-name MyVirtualNetwork \\
--subnet MyAseSubnet
- name: Create External app service environments with large front-ends and scale factor of 10 in existing resource group and vNet.
- name: Create External app service environments v2 with large front-ends and scale factor of 10 in existing resource group and vNet.
text: |
az appservice ase create -n MyAseName -g MyResourceGroup --vnet-name MyVirtualNetwork \\
--subnet MyAseSubnet --front-end-sku I3 --front-end-scale-factor 10 \\
--virtual-ip-type External
- name: Create vNet and app service environment, but do not create network security group and route table in existing resource group.
- name: Create vNet and app service environment v2, but do not create network security group and route table 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/24

az appservice ase create -n MyAseName -g MyResourceGroup --vnet-name MyVirtualNetwork \\
--subnet MyAseSubnet --ignore-network-security-group --ignore-route-table
- name: Create vNet and app service environment in a smaller than recommended subnet in existing resource group.
- name: Create vNet and app service environment v2 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
- name: Create Resource Group, vNet and app service environment v3 with default values.
text: |
az group create -g ASEv3ResourceGroup --location westeurope

az network vnet create -g ASEv3ResourceGroup -n MyASEv3VirtualNetwork \\
--address-prefixes 10.0.0.0/16 --subnet-name Inbound --subnet-prefixes 10.0.0.0/24

az network vnet subnet create -g ASEv3ResourceGroup --vnet-name MyASEv3VirtualNetwork \\
--name Outbound --address-prefixes 10.0.1.0/24

az appservice ase create -n MyASEv3Name -g ASEv3ResourceGroup \\
--vnet-name MyASEv3VirtualNetwork --subnet Outbound --kind asev3
"""

helps['appservice ase create-inbound-services'] = """
type: command
short-summary: Create the inbound services needed in preview for ASEv3 (private endpoint and DNS).
examples:
- name: Create private endpoint, Private DNS Zone, A records and ensure subnet network policy.
text: |
az appservice ase create-inbound-services -n MyASEv3Name -g ASEv3ResourceGroup \\
--vnet-name MyASEv3VirtualNetwork --subnet Inbound
"""


helps['appservice ase update'] = """
type: command
short-summary: Update app service environment.
Expand Down
13 changes: 11 additions & 2 deletions src/azure-cli/azure/cli/command_modules/appservice/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
WINDOWS_RUNTIMES = ['dotnet', 'node', 'java', 'powershell']
ACCESS_RESTRICTION_ACTION_TYPES = ['Allow', 'Deny']
ASE_LOADBALANCER_MODES = ['Internal', 'External']
ASE_KINDS = ['ASEv2', 'ASEv3']


# pylint: disable=too-many-statements, too-many-lines
Expand All @@ -45,10 +46,10 @@ 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), P1V3(Premium V3 Small), P2V3(Premium V3 Medium), P3V3(Premium V3 Large), PC2 (Premium Container Small), PC3 (Premium Container Medium), PC4 (Premium Container Large), I1 (Isolated Small), I2 (Isolated Medium), I3 (Isolated Large)',
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), P1V3(Premium V3 Small), P2V3(Premium V3 Medium), P3V3(Premium V3 Large), PC2 (Premium Container Small), PC3 (Premium Container Medium), PC4 (Premium Container Large), I1 (Isolated Small), I2 (Isolated Medium), I3 (Isolated Large), I1v2 (Isolated V2 Small), I2v2 (Isolated V2 Medium), I3v2 (Isolated V2 Large)',
arg_type=get_enum_type(
['F1', 'FREE', 'D1', 'SHARED', 'B1', 'B2', 'B3', 'S1', 'S2', 'S3', 'P1V2', 'P2V2', 'P3V2', 'P1V3', 'P2V3', 'P3V3', 'PC2', 'PC3',
'PC4', 'I1', 'I2', 'I3']))
'PC4', 'I1', 'I2', 'I3', 'I1v2', 'I2v2', 'I3v2']))
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 Down Expand Up @@ -869,6 +870,8 @@ def load_arguments(self, _):
help='Name of the app service environment',
local_context_attribute=LocalContextAttribute(name='ase_name', actions=[LocalContextAction.SET],
scopes=['appservice']))
c.argument('kind', options_list=['--kind', '-k'], arg_type=get_enum_type(ASE_KINDS),
default='ASEv2', help="Specify App Service Environment version")
c.argument('subnet', help='Name or ID of existing subnet. To create vnet and/or subnet \
use `az network vnet [subnet] create`')
c.argument('vnet_name', help='Name of the vNet. Mandatory if only subnet name is specified.')
Expand Down Expand Up @@ -902,6 +905,12 @@ def load_arguments(self, _):
with self.argument_context('appservice ase list-plans') 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]))
with self.argument_context('appservice ase create-inbound-services') 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('subnet', help='Name or ID of existing subnet for inbound traffic to ASEv3. \
To create vnet and/or subnet use `az network vnet [subnet] create`')
c.argument('vnet_name', help='Name of the vNet. Mandatory if only subnet name is specified.')

# App Service Domain Commands
with self.argument_context('appservice domain create') as c:
Expand Down
Loading