Skip to content

az containerapp registry show raises error if there are no registry configs #32107

@NorthLake

Description

@NorthLake

Describe the bug

Running az containerapp registry show when there are no configuration entries for any registry, the command raises an error.

Related command

az containerapp registry show -n my-container-app -g my-rg --server my-registry.azurecr.io

Errors

Here is the traceback:
'NoneType' object is not iterable
Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 666, in execute
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 703, in _run_job
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 336, in __call__
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 362, in handler
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/arm.py", line 478, in show_exception_handler
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 360, in handler
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/containerapp/custom.py", line 2897, in show_registry
TypeError: 'NoneType' object is not iterable

Issue script & Debug output

Request URL: 'https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.App/containerApps/my-container-app?api-version=2025-01-01'
Request method: 'GET'
Request headers:
    'User-Agent': 'python/3.13.7 (Windows-11-10.0.26100-SP0) AZURECLI/2.77.0 (MSI)'
    'Accept-Encoding': 'gzip, deflate'
    'Accept': '*/*'
    'Connection': 'keep-alive'
    'x-ms-client-request-id': 'fa8fbc48-7ece-4403-aea9-10c6212bf8de'
    'CommandName': 'containerapp registry show'
    'ParameterSetName': '-n -g --server --verbose'
    'Authorization': 'Bearer ...'
Request body:
None
Response status: 200
Response headers:
    'Cache-Control': 'no-cache'
    'Pragma': 'no-cache'
    'Content-Length': '4326'
    'Content-Type': 'application/json; charset=utf-8'
    'Expires': '-1'
    'Vary': 'Accept-Encoding'
    'x-ms-ratelimit-remaining-subscription-reads': '249'
    'api-supported-versions': '2022-03-01, 2022-06-01-preview, 2022-10-01, 2022-11-01-preview, 2023-04-01-preview, 2023-05-01, 2023-05-02-preview, 2023-08-01-preview, 2023-11-02-preview, 2024-02-02-preview, 2024-03-01, 2024-08-02-preview, 2024-10-02-preview, 2025-01-01, 2025-02-02-preview, 2025-07-01, 2025-10-02-preview'
    'X-Powered-By': 'ASP.NET'
    'x-ms-ratelimit-remaining-subscription-global-reads': '3749'
    'x-ms-request-id': 'e97352c6-06b4-4ab2-9059-4b3a31403d9a'
    'x-ms-correlation-request-id': 'e97352c6-06b4-4ab2-9059-4b3a31403d9a'
    'x-ms-routing-request-id': 'WESTEUROPE:20250912T133147Z:e97352c6-06b4-4ab2-9059-4b3a31403d9a'
    'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
    'X-Content-Type-Options': 'nosniff'
    'X-Cache': 'CONFIG_NOCACHE'
    'X-MSEdge-Ref': 'Ref A: 00A64A11AA8F48AAA019BF07C44254E9 Ref B: AMS231032607007 Ref C: 2025-09-12T13:31:47Z'
    'Date': 'Fri, 12 Sep 2025 13:31:47 GMT'
Response content:
{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.App/containerapps/my-container-app","name":"my-container-app","type":"Microsoft.App/containerApps","location":"UK South","systemData":{"createdBy":"...","createdByType":"User","createdAt":"2025-09-12T11:12:59.7873638","lastModifiedBy":"...","lastModifiedByType":"User","lastModifiedAt":"2025-09-12T13:19:18.7222447"},"properties":{"provisioningState":"Failed","runningStatus":"Running","managedEnvironmentId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.App/managedEnvironments/managedEnvironment-my-rg-0000","environmentId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.App/managedEnvironments/managedEnvironment-my-rg-0000","workloadProfileName":"Consumption","outboundIpAddresses":["20.108.216.9","20.108.217.125","74.177.201.70","131.145.91.209","4.158.91.74","4.158.89.64","131.145.40.6","74.177.198.189","85.210.223.160","74.177.245.93","74.177.198.181","131.145.77.209","20.108.124.221","74.177.162.123","20.26.109.122","131.145.124.57","85.210.222.64","20.26.109.180","74.177.141.127","85.210.223.56","74.177.245.142","131.145.83.126","131.145.99.107","20.108.125.221","4.159.25.18","4.158.92.46","20.162.145.125","4.158.143.149","4.158.143.92","4.250.234.44","20.90.238.99","20.90.239.180","85.210.163.187","74.177.240.109","172.166.80.179","131.145.9.241","85.210.166.17","85.210.48.136","74.177.120.102","131.145.48.93","85.210.163.208","74.177.193.62","20.108.130.227","51.142.67.19","20.254.83.139","131.145.82.22","20.254.83.138","4.158.232.14","172.166.87.38","74.177.226.250","20.108.130.191","85.210.25.6","85.210.24.221","4.158.34.249","20.162.138.167","4.158.113.223","4.159.3.89","4.158.100.28"],"latestRevisionName":"my-container-app--aaaaaaa","latestReadyRevisionName":"my-container-app--aaaaaaa","latestRevisionFqdn":"my-container-app--aaaaaaa.yes.uksouth.azurecontainerapps.io","customDomainVerificationId":"...","configuration":{"secrets":null,"activeRevisionsMode":"Single","ingress":{"fqdn":"my-container-app.yes.uksouth.azurecontainerapps.io","external":true,"targetPort":8080,"exposedPort":0,"transport":"Auto","traffic":[{"weight":100,"latestRevision":true}],"customDomains":null,"allowInsecure":false,"ipSecurityRestrictions":null,"corsPolicy":null,"clientCertificateMode":null,"stickySessions":{"affinity":"none"},"additionalPortMappings":null},"registries":null,"dapr":null,"runtime":null,"maxInactiveRevisions":100,"service":null,"identitySettings":[]},"template":{"revisionSuffix":"","terminationGracePeriodSeconds":null,"containers":[{"image":"docker.io/hello-world:latest","name":"my-container-app","env":[],"resources":{"cpu":0.5,"memory":"1Gi","ephemeralStorage":"2Gi"}}],"initContainers":null,"scale":{"minReplicas":0,"maxReplicas":10,"cooldownPeriod":300,"pollingInterval":30,"rules":null},"volumes":null,"serviceBinds":null},"eventStreamEndpoint":"https://uksouth.azurecontainerapps.dev/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/containerApps/my-container-app/eventstream","delegatedIdentities":[]},"identity":{"type":"UserAssigned","userAssignedIdentities":{"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ContainerApps":{"principalId":"00000000-0000-0000-0000-000000000000","clientId":"00000000-0000-0000-0000-000000000000"}}}}
The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 666, in execute
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 703, in _run_job
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 336, in __call__
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 362, in handler
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/arm.py", line 478, in show_exception_handler
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 360, in handler
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/containerapp/custom.py", line 2897, in show_registry
TypeError: 'NoneType' object is not iterable

Expected behavior

A message that no registry configurations are present in the container app

Environment Summary

azure-cli 2.77.0

core 2.77.0
telemetry 1.1.0

Extensions:
account 0.2.5
deploy-to-azure 0.2.0

Dependencies:
msal 1.34.0b1
azure-mgmt-resource 23.3.0

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Config directory 'C:\Users\user.azure'
Extensions directory 'C:\Users\user.azure\cliextensions'

Python (Windows) 3.13.7 (tags/v3.13.7:bcee1c3, Aug 14 2025, 14:15:11) [MSC v.1944 64 bit (AMD64)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

I'm working in an Azure for Students subscription with my school account, if that matters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botContainerAppService AttentionThis issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions