Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ upcoming
0.3.47
++++++
* 'az containerapp add-on' : support for add-on milvus create and delete commands
* [Breaking Change] 'az containerapp service': deprecate command from Azure CLI version 2.59.0
* 'az containerapp up' : Fix registry not found error in subscription when registry server parameters are provided for ACR from another subscription

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.3.47 has been released, please move this description to upcoming.

* [Breaking Change] 'az containerapp service': deprecate command from Azure CLI version 2.59.0
* 'az containerapp add-on' : support for add-on weaviate create and delete commands
* Upgrade api-version to 2023-11-02-preview
* 'az containerapp create/update/up': support --build-env-vars to set environment variables for build
Expand Down
6 changes: 4 additions & 2 deletions src/containerapp/azext_containerapp/_up_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,8 @@ def _set_up_defaults(
env: "ContainerAppEnvironment",
app: "ContainerApp",
custom_location: "CustomLocation",
extension: "Extension"
extension: "Extension",
is_registry_server_params_set=None
):
# If no RG passed in and a singular app exists with the same name, get its env and rg
_get_app_env_and_group(cmd, name, resource_group, env, location, custom_location)
Expand Down Expand Up @@ -1378,7 +1379,8 @@ def _set_up_defaults(

_infer_existing_custom_location_or_extension(cmd, name, location, resource_group, env, custom_location, extension)

_get_acr_from_image(cmd, app)
if not is_registry_server_params_set:

This comment was marked as off-topic.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently with az containerapp up it will failed with error:
Failed to retrieve credentials for container registry. Please provide the registry username and password

_get_acr_from_image(cmd, app)


# Try to get existed connected environment
Expand Down
15 changes: 9 additions & 6 deletions src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def delete_weaviate_service(cmd, service_name, resource_group_name, no_wait=Fals


def create_milvus_service(cmd, service_name, environment_name, resource_group_name, no_wait=False,
disable_warnings=True):
disable_warnings=True):
return DevServiceUtils.create_service(cmd, service_name, environment_name, resource_group_name, no_wait,
disable_warnings, DEV_MILVUS_IMAGE, DEV_MILVUS_SERVICE_TYPE,
DEV_MILVUS_CONTAINER_NAME)
Expand Down Expand Up @@ -1184,7 +1184,9 @@ def containerapp_up(cmd,
env = ContainerAppEnvironment(cmd, environment, resource_group, location=location, logs_key=logs_key, logs_customer_id=logs_customer_id, custom_location_id=custom_location_id, connected_cluster_id=connected_cluster_id)
app = ContainerApp(cmd, name, resource_group, None, image, env, target_port, registry_server, registry_user, registry_pass, env_vars, workload_profile_name, ingress)

_set_up_defaults(cmd, name, resource_group_name, logs_customer_id, location, resource_group, env, app, custom_location, extension)
# Check and see if registry username and passwords are specified. If so, set is_registry_server_params_set to True to use those creds.
is_registry_server_params_set = bool(registry_server and registry_user and registry_pass)

This comment was marked as off-topic.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I noticed the command az containerapp up parameters not support --registry-identity, which supported in command az containerapp create.

_set_up_defaults(cmd, name, resource_group_name, logs_customer_id, location, resource_group, env, app, custom_location, extension, is_registry_server_params_set)

if app.check_exists():
if app.get()["properties"]["provisioningState"] == "InProgress":
Expand Down Expand Up @@ -1972,6 +1974,7 @@ def init_dapr_components(cmd, resource_group_name, environment_name, statestore=
}
}


def assign_env_managed_identity(cmd, name, resource_group_name, system_assigned=False, user_assigned=None, no_wait=False):
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)
managed_env_def = None
Expand Down Expand Up @@ -2049,7 +2052,7 @@ def assign_env_managed_identity(cmd, name, resource_group_name, system_assigned=
payload["identity"]["type"] = "SystemAssigned,UserAssigned"
if managed_env_def["identity"]["type"] == "UserAssigned" and assign_system_identity:
payload["identity"]["type"] = "SystemAssigned,UserAssigned"

else:
if assign_system_identity and assign_user_identities:
payload["identity"]["type"] = "SystemAssigned,UserAssigned"
Expand All @@ -2068,6 +2071,7 @@ def assign_env_managed_identity(cmd, name, resource_group_name, system_assigned=
except Exception as e:
handle_raw_exception(e)


def remove_env_managed_identity(cmd, name, resource_group_name, system_assigned=False, user_assigned=None, no_wait=False):
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)

Expand All @@ -2091,8 +2095,6 @@ def remove_env_managed_identity(cmd, name, resource_group_name, system_assigned=

if not managed_env_def:
raise ResourceNotFoundError("The containerapp env '{}' does not exist".format(name))


# If identity not returned
try:
managed_env_def["identity"]
Expand Down Expand Up @@ -2148,14 +2150,15 @@ def remove_env_managed_identity(cmd, name, resource_group_name, system_assigned=
cmd=cmd, resource_group_name=resource_group_name, name=name, managed_environment_envelope=payload, no_wait=no_wait)
except Exception as e:
handle_raw_exception(e)

try:
return r["identity"]
except:
r["identity"] = {}
r["identity"]["type"] = "None"
return r["identity"]


def show_env_managed_identity(cmd, name, resource_group_name):
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)

Expand Down
Loading