[ContainerApp] Fix az containerapp up --source crash: resolve OS/Architecture models from correct SDK package#33371
Conversation
…om 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 Azure#33369
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
Thank you for your contribution @lygav! We will review the pull request and get back to you soon. |
containerapp up --source crash: resolve OS/Architecture models from correct SDK packageaz containerapp up --source crash: resolve OS/Architecture models from correct SDK package
There was a problem hiding this comment.
Pull request overview
Fixes a crash in az containerapp up --source during ACR build queuing by resolving OS, Architecture, DockerBuildRequest, and PlatformProperties from the correct SDK (azure-mgmt-containerregistrytasks) via ResourceType.MGMT_CONTAINERREGISTRYTASKS, avoiding cmd.get_models() returning None.
Changes:
- Update
queue_acr_build()to loadOS/Architecturemodels fromMGMT_CONTAINERREGISTRYTASKSinstead ofMGMT_CONTAINERREGISTRY. - Update
queue_acr_build()to loadDockerBuildRequest/PlatformPropertiesmodels fromMGMT_CONTAINERREGISTRYTASKSinstead ofMGMT_CONTAINERREGISTRY.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Related command
az containerapp up --sourceDescription
az containerapp up --source .crashes withAttributeError: 'NoneType' object has no attribute 'linux'becausequeue_acr_build()in_utils.pyresolvesOS,Architecture,DockerBuildRequest, andPlatformPropertiesmodels viacmd.get_models()usingResourceType.MGMT_CONTAINERREGISTRYwithoperation_group='runs'.These models have moved to the
azure-mgmt-containerregistrytasksSDK package, socmd.get_models()silently returnsNone, and the subsequentOS.linux.valuecall crashes.This PR updates both
get_models()calls inqueue_acr_build()to useResourceType.MGMT_CONTAINERREGISTRYTASKS, which is already a declared dependency and contains the correct models.Testing Guide
The existing
@live_onlytests intest_containerapp_compose_registries.pycoverqueue_acr_buildand would validate this fix in the nightly live test run.History Notes
[ContainerApp] Fix
az containerapp up --source: resolve OS/Architecture models from correct SDK package (MGMT_CONTAINERREGISTRYTASKS)Fixes #33369
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.