Skip to content

Commit

Permalink
fix ConnectedContainerAppNotSupportIdentity and ex overwrite to None …
Browse files Browse the repository at this point in the history
…by mistake
  • Loading branch information
xinyululala committed Oct 6, 2024
1 parent 490eb34 commit 3e3e148
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/containerapp/azext_containerapp/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ def _polish_bad_errors(ex):
import json
try:
content = json.loads(ex.response.content)
detail = None
if 'message' in content:
detail = content['message']
ex = CLIInternalError(detail)
elif 'Message' in content:
detail = content['Message']

ex = CLIInternalError(detail)
ex = CLIInternalError(detail)
except Exception: # pylint: disable=broad-except
pass
if no_throw:
Expand Down
5 changes: 5 additions & 0 deletions src/containerapp/azext_containerapp/containerapp_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,11 @@ def set_up_system_assigned_identity_as_default_if_using_acr(self):
return

if self.get_argument_registry_identity() is None and self.get_argument_registry_user() is None and self.get_argument_registry_pass() is None:
# Connected ContainerApp Not Support Identity
parsed_managed_env = parse_resource_id(self.get_argument_managed_env())
if "resource_type" in parsed_managed_env:
if parsed_managed_env["resource_type"].lower() == CONNECTED_ENVIRONMENT_RESOURCE_TYPE.lower():
return
self.set_argument_registry_identity('system')

def parent_construct_payload(self):
Expand Down

0 comments on commit 3e3e148

Please sign in to comment.