From f62bc0b92ab2da3c316194c4cd6197dffea026b6 Mon Sep 17 00:00:00 2001 From: Vladi Lyga Date: Wed, 13 May 2026 16:06:46 +0300 Subject: [PATCH] Fix containerapp up --source crash: resolve OS/Architecture models from correct SDK package queue_acr_build() resolves OS and Architecture models from MGMT_CONTAINERREGISTRY, but these models have moved to the azure-mgmt-containerregistrytasks package. This causes cmd.get_models() to return None, crashing with: AttributeError: 'NoneType' object has no attribute 'linux' Update both get_models() calls to use MGMT_CONTAINERREGISTRYTASKS which is already a dependency and contains the correct models. Fixes #33369 --- .../azure/cli/command_modules/containerapp/_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/containerapp/_utils.py b/src/azure-cli/azure/cli/command_modules/containerapp/_utils.py index 4d03c999853..719e5abdb2c 100644 --- a/src/azure-cli/azure/cli/command_modules/containerapp/_utils.py +++ b/src/azure-cli/azure/cli/command_modules/containerapp/_utils.py @@ -1344,14 +1344,14 @@ def queue_acr_build(cmd, registry_rg, registry_name, img_name, src_dir, dockerfi # So we need to update the docker_file_path docker_file_path = docker_file_in_tar - OS, Architecture = cmd.get_models('OS', 'Architecture', resource_type=ResourceType.MGMT_CONTAINERREGISTRY, operation_group='runs') + OS, Architecture = cmd.get_models('OS', 'Architecture', resource_type=ResourceType.MGMT_CONTAINERREGISTRYTASKS, operation_group='runs') # Default platform values platform_os = OS.linux.value platform_arch = Architecture.amd64.value platform_variant = None DockerBuildRequest, PlatformProperties = cmd.get_models('DockerBuildRequest', 'PlatformProperties', - resource_type=ResourceType.MGMT_CONTAINERREGISTRY, operation_group='runs') + resource_type=ResourceType.MGMT_CONTAINERREGISTRYTASKS, operation_group='runs') docker_build_request = DockerBuildRequest( image_names=[img_name], is_push_enabled=True,