Skip to content

[Reference feedback]: Container app create fails with python error #32594

@jackroc97

Description

@jackroc97

Type of issue

Code doesn't work

Reference command name

az containerapp compose create

Feedback

I am running the following command to try and use my existing docker-compose to build a container app:

export LOCATION=eastus2
export RESOURCE_GROUP=rg-my-project
export ENV_NAME=env-my-project

az group create --name $RESOURCE_GROUP --location $LOCATION &&

az containerapp env create \
    --name $ENV_NAME \
    --resource-group $RESOURCE_GROUP \
    --location $LOCATION &&

az containerapp compose create -g $RESOURCE_GROUP \
    --environment $ENV_NAME

And my docker-compose looks something like this (I have removed sensitive data specific to my project):

name: my-project
services:

  # A dependency service that I pull from a container registry
  dependency-project:
    restart: always
    build:
      context: ./stable
      tags:
        - "someurl.com/dependency-project:stable"
    image: someurl.com/dependency-project:stable
    env_file:
      - .env
    ports:
      - "127.0.0.1:4001:4003"
      - "127.0.0.1:4002:4004"
      - "127.0.0.1:5900:5900"

  # My locally-built service
  my-project-service:
    build: .
    env_file:
      - .env
    stdin_open: true
    tty: true
    ports:
      - "127.0.0.1:5001:5001"
    volumes:
      # This ties the container to the host timezone
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
      # Logging direcotory
      - ./logs:/app/logs

I receive the following output:

These container and host configuration elements from the docker-compose file are not supported in Azure Container Apps. For more information about supported configuration, please see https://aka.ms/containerapp/compose/configuration
     services/strategy/stdin_open
     services/strategy/tty
These volume mount elements from the docker-compose file are not supported in Azure Container Apps. For more information about supported storage configuration, please see https://aka.ms/containerapp/compose/volumes
     services/strategy/volumes
The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
    raise ex
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 703, in _run_job
    result = cmd_copy(params)
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 336, in __call__
    return self.handler(*args, **kwargs)
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
    return op(**command_args)
  File "/Users/jrochester/.azure/cliextensions/containerapp/azext_containerapp/custom.py", line 1617, in create_containerapps_from_compose
    environment = resolve_environment_from_service(service)
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/command_modules/containerapp/_compose_utils.py", line 217, in resolve_environment_from_service
    env_vars = service.resolve_environment_hierarchy()
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/pycomposefile/service/service.py", line 141, in resolve_environment_hierarchy
    env_file.update(self.environment)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Page URL

https://learn.microsoft.com/en-us/cli/azure/containerapp/compose?view=azure-cli-latest#az-containerapp-compose-create

Content source URL

https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/docs-ref-autogen/Latest-version/latest/containerapp/compose.yml

Author

@mikefrobbins

Document Id

d10250cd-c6ca-a9a6-d6e8-b93f81b94ff1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botContainerAppService AttentionThis issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions