From d28922092630f56f47ac79198240b06b26c22b97 Mon Sep 17 00:00:00 2001 From: Haroon Feisal <38823870+haroonf@users.noreply.github.com> Date: Tue, 9 Aug 2022 15:51:44 -0700 Subject: [PATCH] Added show_secrets to show. (#142) Co-authored-by: Haroon Feisal --- src/containerapp/azext_containerapp/_params.py | 3 +++ src/containerapp/azext_containerapp/custom.py | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/containerapp/azext_containerapp/_params.py b/src/containerapp/azext_containerapp/_params.py index 3c0aa1a96cf..4aad2cec3d0 100644 --- a/src/containerapp/azext_containerapp/_params.py +++ b/src/containerapp/azext_containerapp/_params.py @@ -111,6 +111,9 @@ def load_arguments(self, _): with self.argument_context('containerapp create', arg_group='Container') as c: c.argument('image', options_list=['--image', '-i'], help="Container image, e.g. publisher/image-name:tag.") + with self.argument_context('containerapp show') as c: + c.argument('show_secrets', help="Show Containerapp secrets.") + with self.argument_context('containerapp update', arg_group='Container') as c: c.argument('image', options_list=['--image', '-i'], help="Container image, e.g. publisher/image-name:tag.") diff --git a/src/containerapp/azext_containerapp/custom.py b/src/containerapp/azext_containerapp/custom.py index 0217f67b785..97c20e8895c 100644 --- a/src/containerapp/azext_containerapp/custom.py +++ b/src/containerapp/azext_containerapp/custom.py @@ -813,11 +813,14 @@ def update_containerapp(cmd, no_wait) -def show_containerapp(cmd, name, resource_group_name): +def show_containerapp(cmd, name, resource_group_name, show_secrets=False): _validate_subscription_registered(cmd, CONTAINER_APPS_RP) try: - return ContainerAppClient.show(cmd=cmd, resource_group_name=resource_group_name, name=name) + r = ContainerAppClient.show(cmd=cmd, resource_group_name=resource_group_name, name=name) + if show_secrets: + _get_existing_secrets(cmd, resource_group_name, name, r) + return r except CLIError as e: handle_raw_exception(e)