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
14 changes: 13 additions & 1 deletion src/azure-cli/azure/cli/command_modules/appservice/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
- name: Create a Windows container app service plan.
text: >
az appservice plan create -g MyResourceGroup -n MyPlan \\
--hyper-v --sku P3V3
--hyper-v --sku P1V3
- name: Create an app service plan for app service environment.
text: >
az appservice plan create -g MyResourceGroup -n MyPlan \\
Expand Down Expand Up @@ -1434,6 +1434,12 @@
- name: Create a web app with the default configuration.
text: >
az webapp create -g MyResourceGroup -p MyPlan -n MyUniqueAppName
- name: Create a web app with a java|11|Java SE|8 runtime using '|' delimiter.
text: >
az webapp create -g MyResourceGroup -p MyPlan -n MyUniqueAppName --runtime "java|11|Java SE|8"
- name: Create a web app with a java|11|Java SE|8 runtime using ':' delimiter.
text: >
az webapp create -g MyResourceGroup -p MyPlan -n MyUniqueAppName --runtime "java:11:Java SE:8"
- name: Create a web app with a NodeJS 10.14 runtime and deployed from a local git repository.
text: >
az webapp create -g MyResourceGroup -p MyPlan -n MyUniqueAppName --runtime "node|10.14" --deployment-local-git
Expand Down Expand Up @@ -1958,6 +1964,12 @@
- name: Create a web app with a specified name
text: >
az webapp up -n MyUniqueAppName
- name: Create a web app with a specified name and a java|11|Java SE|8 runtime using '|' delimiter
text: >
az webapp up -n MyUniqueAppName --runtime "java|11|Java SE|8"
- name: Create a web app with a specified name and a java|11|Java SE|8 runtime using ':' delimiter
text: >
az webapp up -n MyUniqueAppName --runtime "java:11:Java SE:8"
- name: Create a web app in a specific region, by running the command from the folder where the code to be deployed exists.
text: >
az webapp up -l locationName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def load_arguments(self, _):
c.argument('docker_registry_server_password', options_list=['--docker-registry-server-password', '-w'], help='The container registry server password. Required for private registries.')
c.argument('multicontainer_config_type', options_list=['--multicontainer-config-type'], help="Linux only.", arg_type=get_enum_type(MULTI_CONTAINER_TYPES))
c.argument('multicontainer_config_file', options_list=['--multicontainer-config-file'], help="Linux only. Config file for multicontainer apps. (local or remote)")
c.argument('runtime', options_list=['--runtime', '-r'], help="canonicalized web runtime in the format of Framework|Version, e.g. \"PHP|7.2\". Allowed delimiters: \"|\", \" \", \":\". "
c.argument('runtime', options_list=['--runtime', '-r'], help="canonicalized web runtime in the format of Framework|Version, e.g. \"PHP|7.2\". Allowed delimiters: \"|\" or \":\". "
"Use `az webapp list-runtimes` for available list") # TODO ADD completer
c.argument('plan', options_list=['--plan', '-p'], configured_default='appserviceplan',
completer=get_resource_name_completion_list('Microsoft.Web/serverFarms'),
Expand Down Expand Up @@ -609,7 +609,7 @@ def load_arguments(self, _):
local_context_attribute=LocalContextAttribute(name='plan_name', actions=[LocalContextAction.GET]))
c.argument('sku', arg_type=sku_arg_type)
c.argument('os_type', options_list=['--os-type'], arg_type=get_enum_type(OS_TYPES), help="Set the OS type for the app to be created.")
c.argument('runtime', options_list=['--runtime', '-r'], help="canonicalized web runtime in the format of Framework|Version, e.g. \"PHP|7.2\". Allowed delimiters: \"|\", \" \", \":\". "
c.argument('runtime', options_list=['--runtime', '-r'], help="canonicalized web runtime in the format of Framework|Version, e.g. \"PHP|7.2\". Allowed delimiters: \"|\" or \":\". "
"Use `az webapp list-runtimes` for available list.")
c.argument('dryrun', help="show summary of the create and deploy operation instead of executing it",
default=False, action='store_true')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2619,7 +2619,13 @@ def __init__(self, cmd, client, linux=False):
@staticmethod
def remove_delimiters(runtime):
import re
runtime = re.split('[| :]', runtime) # delimiters allowed: '|', ' ', ':'
# delimiters allowed: '|', ':'
if '|' in runtime:
runtime = re.split('[|]', runtime)
elif ':' in runtime:
runtime = re.split('[:]', runtime)
else:
runtime = [runtime]
return '|'.join(filter(None, runtime))

def resolve(self, display_name):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interactions:
- -n -g --plan --os --runtime --sku --dryrun
User-Agent:
- python/3.6.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.16.0
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: POST
Expand All @@ -34,7 +34,7 @@ interactions:
content-type:
- application/json
date:
- Mon, 14 Dec 2020 20:59:08 GMT
- Thu, 14 Jan 2021 03:44:23 GMT
expires:
- '-1'
pragma:
Expand Down Expand Up @@ -71,7 +71,7 @@ interactions:
- -n -g --plan --os --runtime --sku --dryrun
User-Agent:
- python/3.6.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.16.0
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: GET
Expand Down Expand Up @@ -186,7 +186,7 @@ interactions:
content-type:
- application/json
date:
- Mon, 14 Dec 2020 20:59:09 GMT
- Thu, 14 Jan 2021 03:44:23 GMT
expires:
- '-1'
pragma:
Expand Down Expand Up @@ -223,11 +223,11 @@ interactions:
- -n -g --plan --os --runtime --sku --dryrun
User-Agent:
- python/3.6.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.16.0
azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: HEAD
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001?api-version=2020-06-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001?api-version=2020-10-01
response:
body:
string: ''
Expand All @@ -237,7 +237,7 @@ interactions:
content-length:
- '0'
date:
- Mon, 14 Dec 2020 20:59:09 GMT
- Thu, 14 Jan 2021 03:44:23 GMT
expires:
- '-1'
pragma:
Expand All @@ -264,7 +264,7 @@ interactions:
- -n -g --plan --os --runtime --sku --dryrun
User-Agent:
- python/3.6.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.16.0
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: GET
Expand All @@ -280,7 +280,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Mon, 14 Dec 2020 20:59:09 GMT
- Thu, 14 Jan 2021 03:44:23 GMT
expires:
- '-1'
pragma:
Expand Down Expand Up @@ -309,11 +309,11 @@ interactions:
- -n -g --plan --os --runtime --sku --dryrun
User-Agent:
- python/3.6.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.16.0
azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: HEAD
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001?api-version=2020-06-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001?api-version=2020-10-01
response:
body:
string: ''
Expand All @@ -323,7 +323,7 @@ interactions:
content-length:
- '0'
date:
- Mon, 14 Dec 2020 20:59:10 GMT
- Thu, 14 Jan 2021 03:44:24 GMT
expires:
- '-1'
pragma:
Expand All @@ -350,7 +350,7 @@ interactions:
- -n -g --plan --os --runtime --sku --dryrun
User-Agent:
- python/3.6.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.16.0
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: GET
Expand All @@ -366,7 +366,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Mon, 14 Dec 2020 20:59:11 GMT
- Thu, 14 Jan 2021 03:44:24 GMT
expires:
- '-1'
pragma:
Expand Down Expand Up @@ -399,7 +399,7 @@ interactions:
- -n -g --plan --os --runtime --sku --dryrun
User-Agent:
- python/3.6.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.16.0
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: POST
Expand All @@ -415,7 +415,7 @@ interactions:
content-type:
- application/json
date:
- Mon, 14 Dec 2020 20:59:11 GMT
- Thu, 14 Jan 2021 03:44:25 GMT
expires:
- '-1'
pragma:
Expand Down Expand Up @@ -452,7 +452,7 @@ interactions:
- -n -g --plan --os --runtime --sku --dryrun
User-Agent:
- python/3.6.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.16.0
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: GET
Expand Down Expand Up @@ -567,7 +567,7 @@ interactions:
content-type:
- application/json
date:
- Mon, 14 Dec 2020 20:59:11 GMT
- Thu, 14 Jan 2021 03:44:25 GMT
expires:
- '-1'
pragma:
Expand Down Expand Up @@ -604,11 +604,11 @@ interactions:
- -n -g --plan --os --runtime --sku --dryrun
User-Agent:
- python/3.6.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.16.0
azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: HEAD
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001?api-version=2020-06-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001?api-version=2020-10-01
response:
body:
string: ''
Expand All @@ -618,7 +618,7 @@ interactions:
content-length:
- '0'
date:
- Mon, 14 Dec 2020 20:59:12 GMT
- Thu, 14 Jan 2021 03:44:25 GMT
expires:
- '-1'
pragma:
Expand All @@ -645,7 +645,7 @@ interactions:
- -n -g --plan --os --runtime --sku --dryrun
User-Agent:
- python/3.6.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.16.0
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: GET
Expand All @@ -661,7 +661,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Mon, 14 Dec 2020 20:59:13 GMT
- Thu, 14 Jan 2021 03:44:26 GMT
expires:
- '-1'
pragma:
Expand Down Expand Up @@ -690,11 +690,11 @@ interactions:
- -n -g --plan --os --runtime --sku --dryrun
User-Agent:
- python/3.6.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.16.0
azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: HEAD
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001?api-version=2020-06-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001?api-version=2020-10-01
response:
body:
string: ''
Expand All @@ -704,7 +704,7 @@ interactions:
content-length:
- '0'
date:
- Mon, 14 Dec 2020 20:59:13 GMT
- Thu, 14 Jan 2021 03:44:26 GMT
expires:
- '-1'
pragma:
Expand All @@ -731,7 +731,7 @@ interactions:
- -n -g --plan --os --runtime --sku --dryrun
User-Agent:
- python/3.6.7 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.16.0
azure-mgmt-web/0.48.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: GET
Expand All @@ -747,7 +747,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Mon, 14 Dec 2020 20:59:14 GMT
- Thu, 14 Jan 2021 03:44:26 GMT
expires:
- '-1'
pragma:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,23 +627,21 @@ def test_webapp_up_runtime_delimiters(self, resource_group):

# test dryrun operation
result = self.cmd(
'webapp up -n {} -g {} --plan {} --os "linux" --runtime "node 10.6" --sku "S1" --dryrun'.format(webapp_name, resource_group, plan)).get_output_in_json()
'webapp up -n {} -g {} --plan {} --os "windows" --runtime "java|1.8|Java SE|8" --sku "S1" --dryrun'.format(webapp_name, resource_group, plan)).get_output_in_json()
self.assertTrue(result['sku'].lower() == 'standard')
self.assertTrue(result['name'].startswith(webapp_name))
self.assertTrue(result['src_path'].replace(
os.sep + os.sep, os.sep), up_working_dir)
self.assertTrue(result['runtime_version'] == 'node|10.6')
self.assertTrue(result['os'].lower() == 'linux')
self.assertTrue(result['runtime_version'] == 'java|1.8|Java SE|8')

# test dryrun operation
result = self.cmd(
'webapp up -n {} -g {} --plan {} --os "linux" --runtime "node:10.1" --sku "S1" --dryrun'.format(webapp_name, resource_group, plan)).get_output_in_json()
'webapp up -n {} -g {} --plan {} --os "windows" --runtime "java:1.8:Java SE:8" --sku "S1" --dryrun'.format(webapp_name, resource_group, plan)).get_output_in_json()
self.assertTrue(result['sku'].lower() == 'standard')
self.assertTrue(result['name'].startswith(webapp_name))
self.assertTrue(result['src_path'].replace(
os.sep + os.sep, os.sep), up_working_dir)
self.assertTrue(result['runtime_version'] == 'node|10.1')
self.assertTrue(result['os'].lower() == 'linux')
self.assertTrue(result['runtime_version'] == 'java|1.8|Java SE|8')

# cleanup
# switch back the working dir
Expand Down