Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update minCliVersion, remove un-needed commands #3721

Merged
merged 3 commits into from
Jul 30, 2021
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
5 changes: 5 additions & 0 deletions src/service_name.json
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,11 @@
"Command": "az vm",
"AzureServiceName": "Azure Virtual Machines",
"URL": "https://docs.microsoft.com/en-us/azure/virtual-machines/"
},
{
"Command": "az webapp",
"AzureServiceName": "Azure Web Apps",
"URL": "https://docs.microsoft.com/en-us/azure/app-service/"
}
]

38 changes: 1 addition & 37 deletions src/webapp/azext_webapp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,9 @@ def __init__(self, cli_ctx=None):
operations_tmpl='azext_webapp.custom#{}')
super(WebappExtCommandLoader, self).__init__(cli_ctx=cli_ctx,
custom_command_type=webapp_custom,
resource_type=ResourceType.MGMT_CONTAINERREGISTRY)
resource_type=ResourceType.MGMT_APPSERVICE)

def load_command_table(self, _):
with self.command_group('webapp') as g:
g.custom_command('container up', 'create_deploy_container_app', exception_handler=ex_handler_factory())
g.custom_command('remote-connection create', 'create_tunnel')
g.custom_command('deploy', 'perform_onedeploy')

with self.command_group('webapp scan') as g:
g.custom_command('start', 'start_scan')
g.custom_command('show-result', 'get_scan_result')
Expand All @@ -39,43 +34,12 @@ def load_command_table(self, _):
def load_arguments(self, _):
# pylint: disable=line-too-long
# PARAMETER REGISTRATION
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',
help="name of the webapp. You can configure the default using 'az configure --defaults web=<name>'")

with self.argument_context('webapp container up') as c:
c.argument('name', arg_type=webapp_name_arg_type)
c.argument('source_location', options_list=['--source-location', '-s'],
help='the path to the web app source directory')
c.argument('docker_custom_image_name', options_list=['--docker-custom-image-name', '-i'],
help='the container image name and optionally the tag name (currently public DockerHub images only)')
c.argument('dryrun', help="show summary of the create and deploy operation instead of executing it", default=False, action='store_true')
c.argument('registry_rg', help="the resource group of the Azure Container Registry")
c.argument('registry_name', help="the name of the Azure Container Registry")
c.argument('slot', help="Name of the deployment slot to use")
with self.argument_context('webapp remote-connection create') as c:
c.argument('port', options_list=['--port', '-p'],
help='Port for the remote connection. Default: Random available port', type=int)
c.argument('name', options_list=['--name', '-n'], help='Name of the webapp to connect to')
c.argument('slot', help="Name of the deployment slot to use")
with self.argument_context('webapp scan') as c:
c.argument('name', options_list=['--name', '-n'], help='Name of the webapp to connect to')
c.argument('scan_id', options_list=['--scan-id'], help='Unique scan id')
c.argument('timeout', options_list=['--timeout'], help='Timeout for operation in milliseconds')
c.argument('slot', help="Name of the deployment slot to use")

with self.argument_context('webapp deploy') as c:
c.argument('name', options_list=['--name'], help='Name of the webapp to connect to')
c.argument('src_path', options_list=['--src-path'], help='Path of the file to be deployed. Example: /mnt/apps/myapp.war')
c.argument('src_url', options_list=['--src-url'], help='url to download the package from. Example: http://mysite.com/files/myapp.war?key=123')
c.argument('target_path', options_list=['--target-path'], help='Target path relative to wwwroot to which the file will be deployed to.')
c.argument('artifact_type', options_list=['--type'], help='Type of deployment requested')
c.argument('is_async', options_list=['--async'], help='Asynchronous deployment', choices=['true', 'false'])
c.argument('restart', options_list=['--restart'], help='restart or not. default behavior is to restart.', choices=['true', 'false'])
c.argument('clean', options_list=['--clean'], help='clean or not. default is target-type specific.', choices=['true', 'false'])
c.argument('ignore_stack', options_list=['--ignore-stack'], help='should override the default stack check', choices=['true', 'false'])
c.argument('timeout', options_list=['--timeout'], help='Timeout for operation in milliseconds')
c.argument('slot', help="Name of the deployment slot to use")


COMMAND_LOADER_CLS = WebappExtCommandLoader
35 changes: 0 additions & 35 deletions src/webapp/azext_webapp/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@

from knack.help_files import helps

helps['webapp remote-connection'] = """
type: group
short-summary: Create a remote connection using a tcp tunnel to your web app
"""

helps['webapp remote-connection create'] = """
type: command
short-summary: Creates a remote connection using a tcp tunnel to your web app
"""

helps['webapp scan'] = """
type: group
short-summary: Holds group of commands which cater to webapp scans. Currently available only for Linux based webapps.
Expand Down Expand Up @@ -44,28 +34,3 @@
type: command
short-summary: Stops the current executing scan. Does nothing if no scan is executing.
"""

helps['webapp container'] = """
type: group
short-summary: Group of commands related to webapp container operations
"""

helps['webapp container up'] = """
type: command
short-summary: Experimental command to create and deploy a container webapp.
examples:
- name: Deploy a container using an image from DockerHub. This example uses nginx.
text: az webapp container up -n AppName -i nginx
- name: Upload files from the current directory to an Azure Container Registry, then build a container image and deploy it to a web app. The Azure Container Registry must already exist.
text: az webapp container up -n AppName --registry-rg ContainerRegistryResourceGroup --registry-name ContainerRegistryName
"""

helps['webapp deploy'] = """
type: command
short-summary: Deploys a provided artifact to Azure Web Apps.
examples:
- name: Deploy a war file asynchronously.
text: az webapp deploy --resource-group ResouceGroup --name AppName --src-path SourcePath --type war --async IsAsync
- name: Deploy a static text file to wwwroot/staticfiles/test.txt
text: az webapp deploy --resource-group ResouceGroup --name AppName --src-path SourcePath --type static --target-path staticfiles/test.txt
"""
95 changes: 0 additions & 95 deletions src/webapp/azext_webapp/acr_util.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/webapp/azext_webapp/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"azext.minCliCoreVersion": "2.0.46",
"azext.minCliCoreVersion": "2.23.0",
"azext.isPreview": true
}
Loading