Skip to content

[Reference feedback]: Please include more info on topics such as port mapping, accessing secrets, and using volues. #32593

@jackroc97

Description

@jackroc97

Type of issue

Missing information

Reference command name

az containerapp compose create

Feedback

There are a few features of docker-compose that I use for local runs that don't seem to map directly when I use az containerapp compose create.

I am using the following bash script for my build:

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 info 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 am having issues with the following features:

Port mapping

As you can see from my docker-compose file, I map multiple ports for one of the containers. az containerapp compose create makes me pick one when I run the command.

Volume Mounts

I map a log directory in my docker-compose. I assume I will have to configure some kind of Azure resource for volume mounting, but the documentation does not cover this.

Secret Environment Variables

My .env file will contain some sensitive info, which I will need to store in an Azure Key Vault. The documentation does not describe how to reference this in the docker-compose file.

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 botContainerAppDocumentationService AttentionThis issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-triageThis is a new issue that needs to be triaged to the appropriate team.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions