Closed yugangw-msft closed 6 years ago
This local validation code is blocking Azure Web Apps for Containers from being listed or shown:
FUNCTION_APP_TYPES = ['functionapp', 'functionapp,linux']
WEB_APP_TYPES = ['app', 'app,linux']
def validate_existing_function_app(cmd, namespace):
_validate_existing_app(cmd.cli_ctx, namespace, FUNCTION_APP_TYPES)
def validate_existing_web_app(cmd, namespace):
_validate_existing_app(cmd.cli_ctx, namespace, WEB_APP_TYPES)
def _validate_existing_app(cli_ctx, namespace, app_type):
client = web_client_factory(cli_ctx)
instance = client.web_apps.get(namespace.resource_group_name, namespace.name)
if instance.kind not in app_type: # pylint: disable=no-member
raise CLIError('Usage Error: {} is not a correct app type'.format(namespace.name))
setattr(namespace, 'app_instance', instance)
The kind
for Web Apps for Containers is 'app,linux,container'
. Any new web app types, e.g., web apps for containers and Azure Functions Containers, will appear "broken" from a CLI end user perspective until this array is updated to include the correct kind
values. Users will receive the 'Usage Error: {} is not a correct app type'
message for (at least) webapp list
and webapp show
if their webapp is container based. Is there a more dynamic way to perform this client side validation? Is this client side validation necessary?
@josalem, I will remove the client logics considering the webapp back-end service is continuously changing w/o notifications // cc: @ahmedelnably @panchagnula
The change was in. You can verify through docker: docker run -v ${HOME}:/root -it azuresdk/azure-cli-python:dev
Verified fixed via prompt.ws for #5335 .
With new app types added for linux like
app,linux
andfunctionapp,linux
, the get/list command gets out of sync, because it still filter using old types ofapp
andfunctionapp