Skip to content

[Container app] Fix #33369: az containerapp up: Resolve OS/Architecture models from correct SDK package - #33371

Merged
Julie Zhu (yanzhudd) merged 1 commit into
Azure:devfrom
lygav:fix/containerapp-up-os-model-resolution
May 26, 2026
Merged

Julie Zhu (yanzhudd) merged 1 commit into
Azure:devfrom
lygav:fix/containerapp-up-os-model-resolution

Conversation

@lygav

@lygav Vlad Lyga (lygav) commented May 13, 2026

Copy link
Copy Markdown
Contributor

Related command
az containerapp up --source

Description

az containerapp up --source . crashes with AttributeError: 'NoneType' object has no attribute 'linux' because queue_acr_build() in _utils.py resolves OS, Architecture, DockerBuildRequest, and PlatformProperties models via cmd.get_models() using ResourceType.MGMT_CONTAINERREGISTRY with operation_group='runs'.

These models have moved to the azure-mgmt-containerregistrytasks SDK package, so cmd.get_models() silently returns None, and the subsequent OS.linux.value call crashes.

This PR updates both get_models() calls in queue_acr_build() to use ResourceType.MGMT_CONTAINERREGISTRYTASKS, which is already a declared dependency and contains the correct models.

Testing Guide

# Create a directory with a Dockerfile
mkdir test-app && cd test-app
cat > Dockerfile <<EOF
FROM ubuntu:24.04
CMD ["sleep", "infinity"]
EOF

# This should no longer crash
az containerapp up -n my-app -g my-rg --environment my-env --source .

The existing @live_only tests in test_containerapp_compose_registries.py cover queue_acr_build and would validate this fix in the nightly live test run.

History Notes

[Container app] Fix #33369: az containerapp up: Resolve OS/Architecture models from correct SDK package


This checklist is used to make sure that common guidelines for a pull request are followed.

…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
@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented May 13, 2026

Copy link
Copy Markdown
️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented May 13, 2026

Copy link
Copy Markdown
️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions

Copy link
Copy Markdown

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution Vlad Lyga (@lygav)! We will review the pull request and get back to you soon.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Auto-Assign Auto assign by bot label May 13, 2026
@lygav Vlad Lyga (lygav) changed the title Fix containerapp up --source crash: resolve OS/Architecture models from correct SDK package [ContainerApp] Fix az containerapp up --source crash: resolve OS/Architecture models from correct SDK package May 13, 2026

Copilot AI left a comment

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.

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 load OS/Architecture models from MGMT_CONTAINERREGISTRYTASKS instead of MGMT_CONTAINERREGISTRY.
  • Update queue_acr_build() to load DockerBuildRequest/PlatformProperties models from MGMT_CONTAINERREGISTRYTASKS instead of MGMT_CONTAINERREGISTRY.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yanzhudd

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@yanzhudd Julie Zhu (yanzhudd) changed the title [ContainerApp] Fix az containerapp up --source crash: resolve OS/Architecture models from correct SDK package [Container App] Fix az containerapp up --source crash: resolve OS/Architecture models from correct SDK package May 25, 2026
@yanzhudd

Copy link
Copy Markdown
Contributor

Hi Vlad Lyga (@lygav)
May I ask if this PR is ready to review/merge?
Please note that the code completion time for the upcoming release is on 05/26/2026 at 06:00 UTC. If you want to catch up the release train, please let us know asap.

@lygav

Copy link
Copy Markdown
Contributor Author

Julie Zhu (@yanzhudd) Hi, yes it is ready for review

@yanzhudd Julie Zhu (yanzhudd) changed the title [Container App] Fix az containerapp up --source crash: resolve OS/Architecture models from correct SDK package [Container App] Fix #33369: az containerapp up: Resolve OS/Architecture models from correct SDK package May 26, 2026
@yanzhudd Julie Zhu (yanzhudd) changed the title [Container App] Fix #33369: az containerapp up: Resolve OS/Architecture models from correct SDK package [Container app] Fix #33369: az containerapp up: Resolve OS/Architecture models from correct SDK package May 26, 2026
@yanzhudd
Julie Zhu (yanzhudd) merged commit 5ca4fa5 into Azure:dev May 26, 2026
67 of 68 checks passed
@lygav
Vlad Lyga (lygav) deleted the fix/containerapp-up-os-model-resolution branch May 26, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-observability-squad Auto-Assign Auto assign by bot ContainerApp customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

az containerapp up --source crashes on macOS: OS is None causing OS.linux.value to fail

5 participants