Skip to content

Commit

Permalink
[Containerapp] Release version 1.0.0b2 (Azure#7976)
Browse files Browse the repository at this point in the history
  • Loading branch information
Greedygre authored Sep 13, 2024
1 parent 63339cb commit 2477438
Show file tree
Hide file tree
Showing 5 changed files with 12,886 additions and 2,945 deletions.
3 changes: 3 additions & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Release History
===============
upcoming
++++++

1.0.0b2
++++++
* 'az containerapp create': Fix container app create with registry msi
* 'az containerapp job create': Fix container app job create with registry msi

Expand Down
16 changes: 10 additions & 6 deletions src/containerapp/azext_containerapp/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,24 +750,28 @@ def is_registry_msi_system_environment(identity):
def env_has_managed_identity(cmd, resource_group_name, env_name, identity):
identity = identity.lower()

managed_env_info = None
try:
managed_env_info = ManagedEnvironmentPreviewClient.show(cmd=cmd, resource_group_name=resource_group_name, name=env_name)
except Exception as e:
handle_raw_exception(e)
handle_non_404_status_code_exception(e)

if not managed_env_info:
raise ValidationError("The managed environment '{}' does not exist. Please specify a valid environment.".format(env_name))

if safe_get(managed_env_info, "identity") is None:
return False

identityType = safe_get(managed_env_info, "identity", "type")
if is_registry_msi_system(identity) and identityType and identityType.__contains__("SystemAssigned"):
identity_type = safe_get(managed_env_info, "identity", "type")
if is_registry_msi_system(identity) and identity_type and identity_type.__contains__("SystemAssigned"):
return True

userAssignedIdentities = safe_get(managed_env_info, "identity", "userAssignedIdentities")
if userAssignedIdentities is None:
user_assigned_identities = safe_get(managed_env_info, "identity", "userAssignedIdentities")
if user_assigned_identities is None:
return False

result = False
for msi in userAssignedIdentities:
for msi in user_assigned_identities:
if msi.lower() == identity:
result = True
break
Expand Down
Loading

0 comments on commit 2477438

Please sign in to comment.