Skip to content

Commit

Permalink
Merge pull request #3 from sanchitmehta/master
Browse files Browse the repository at this point in the history
Add `az webapp up` support
  • Loading branch information
ebencarek authored May 27, 2020
2 parents c911d92 + cb4c3c4 commit c358244
Show file tree
Hide file tree
Showing 8 changed files with 764 additions and 5 deletions.
22 changes: 22 additions & 0 deletions src/appservice-kube/azext_appservice_kube/_appservice_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from ._client_factory import web_client_factory


def _generic_site_operation(cli_ctx, resource_group_name, name, operation_name, slot=None,
extra_parameter=None, client=None):
client = client or web_client_factory(cli_ctx)
operation = getattr(client.web_apps,
operation_name if slot is None else operation_name + '_slot')
if slot is None:
return (operation(resource_group_name, name)
if extra_parameter is None else operation(resource_group_name,
name, extra_parameter))

return (operation(resource_group_name, name, slot)
if extra_parameter is None else operation(resource_group_name,
name, extra_parameter, slot))

4 changes: 4 additions & 0 deletions src/appservice-kube/azext_appservice_kube/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ def _polish_bad_errors(ex):
def web_client_factory(cli_ctx, **_):
return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_APPSERVICE)

def resource_client_factory(cli_ctx, **_):
from azure.cli.core.profiles import ResourceType
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES)


def cf_kube_environments(cli_ctx, *_):
return web_client_factory(cli_ctx).kube_environments
Expand Down
14 changes: 14 additions & 0 deletions src/appservice-kube/azext_appservice_kube/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,21 @@
WINDOWS_RUNTIMES = ['dotnet', 'node', 'java', 'powershell']

NODE_VERSION_DEFAULT = "10.14"
NETCORE_VERSION_DEFAULT = "2.2"
DOTNET_VERSION_DEFAULT = "4.7"
PYTHON_VERSION_DEFAULT = "3.7"
NETCORE_RUNTIME_NAME = "dotnetcore"
DOTNET_RUNTIME_NAME = "aspnet"
NODE_RUNTIME_NAME = "node"
PYTHON_RUNTIME_NAME = "python"
OS_DEFAULT = "Windows"
STATIC_RUNTIME_NAME = "static" # not an official supported runtime but used for CLI logic
NODE_VERSIONS = ['4.4', '4.5', '6.2', '6.6', '6.9', '6.11', '8.0', '8.1', '8.9', '8.11', '10.1', '10.10', '10.14']
PYTHON_VERSIONS = ['3.7', '3.6', '2.7']
NETCORE_VERSIONS = ['1.0', '1.1', '2.1', '2.2']
DOTNET_VERSIONS = ['3.5', '4.7']

LINUX_SKU_DEFAULT = "P1V2"
FUNCTIONS_VERSIONS = ['2', '3']

# functions version : default node version
Expand Down
Loading

0 comments on commit c358244

Please sign in to comment.