From 2f2176ef515cc8ff17c30d5e0dab36595cb95660 Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Thu, 9 Jun 2022 11:20:09 -0700 Subject: [PATCH] Fix https://github.com/microsoft/azure-container-apps/issues/261 --- src/containerapp/HISTORY.rst | 1 + src/containerapp/azext_containerapp/custom.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/containerapp/HISTORY.rst b/src/containerapp/HISTORY.rst index a69f765e906..75bd47025ad 100644 --- a/src/containerapp/HISTORY.rst +++ b/src/containerapp/HISTORY.rst @@ -6,6 +6,7 @@ Release History 0.3.7 ++++++ * 'az containerapp env create': fixed bug where "--internal-only" didn't work +* 'az containerapp registry set': remove username/password if setting identity and vice versa 0.3.6 ++++++ diff --git a/src/containerapp/azext_containerapp/custom.py b/src/containerapp/azext_containerapp/custom.py index 67885a6bc2a..dce1f755718 100644 --- a/src/containerapp/azext_containerapp/custom.py +++ b/src/containerapp/azext_containerapp/custom.py @@ -1729,6 +1729,7 @@ def set_registry(cmd, name, resource_group_name, server, username=None, password updating_existing_registry = True if username: r["username"] = username + r["identity"] = None if password: r["passwordSecretRef"] = store_as_secret_and_return_secret_ref( containerapp_def["properties"]["configuration"]["secrets"], @@ -1736,8 +1737,11 @@ def set_registry(cmd, name, resource_group_name, server, username=None, password r["server"], password, update_existing_secret=True) + r["identity"] = None if identity: r["identity"] = identity + r["username"] = None + r["passwordSecretRef"] = None # If not updating existing registry, add as new registry if not updating_existing_registry: