Describe the bug
az containerapp up --source . crashes during ACR build with AttributeError: 'NoneType' object has no attribute 'linux' at _utils.py:1349.
The root cause is in queue_acr_build() which resolves SDK models via:
OS, Architecture = cmd.get_models('OS', 'Architecture',
resource_type=ResourceType.MGMT_CONTAINERREGISTRY, operation_group='runs')
cmd.get_models() calls get_versioned_sdk() which looks up the API profile for MGMT_CONTAINERREGISTRY and imports from its models module. This returns None (silently) because the OS and Architecture enums no longer exist under the runs operation group in azure-mgmt-containerregistry.
These models have moved to the separate azure-mgmt-containerregistrytasks package (see _enums.py), but queue_acr_build still resolves them from the old location.
The code then calls OS.linux.value on None and crashes.
Command
az containerapp up \
-n my-app \
-g my-resource-group \
--environment my-environment \
--location westus \
--source .
Error
The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'linux'
Traceback (most recent call last):
...
File "azure/cli/command_modules/containerapp/_utils.py", line 1349, in queue_acr_build
platform_os = OS.linux.value
^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'linux'
Environment
- Azure CLI version: 2.86.0 (upgraded from 2.84, which worked)
- OS: macOS (Apple Silicon, Homebrew install)
- Python: 3.13
Dockerfile used
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y \
strace gdb python3 libcap2-bin procps \
&& rm -rf /var/lib/apt/lists/*
CMD ["sleep", "infinity"]
Describe the bug
az containerapp up --source .crashes during ACR build withAttributeError: 'NoneType' object has no attribute 'linux'at_utils.py:1349.The root cause is in
queue_acr_build()which resolves SDK models via:cmd.get_models()callsget_versioned_sdk()which looks up the API profile forMGMT_CONTAINERREGISTRYand imports from itsmodelsmodule. This returnsNone(silently) because theOSandArchitectureenums no longer exist under therunsoperation group inazure-mgmt-containerregistry.These models have moved to the separate
azure-mgmt-containerregistrytaskspackage (see_enums.py), butqueue_acr_buildstill resolves them from the old location.The code then calls
OS.linux.valueonNoneand crashes.Command
az containerapp up \ -n my-app \ -g my-resource-group \ --environment my-environment \ --location westus \ --source .Error
Environment
Dockerfile used