Skip to content

ERROR: Usage error: --container-name is required when adding or updating a container. #62

@canserhat77

Description

@canserhat77

Hi,

In my case container app have 2 images. First one is app image and second one is sidecar image to forward logs. It was working without yaml config file before I've added sidecar. Once I added, it gave me the following error:

ERROR: Usage error: --container-name is required when adding or updating a container.

So' I have decided use yaml config file option. But looks like I need to set image name which is created by the pipeline dynamically.

Is there a way to pass a parameter to the yaml file? Or indicating image name without using yaml file even better.

My action is like below

jobs:
release:
runs-on: ubuntu-latest
environment: ${{ inputs.Environment }}
steps:
- name: Log in to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZCreds }}

    - uses: actions/checkout@v4
  
    - name: Build and deploy Container App
      uses: azure/container-apps-deploy-action@v1
      with:
        imageToDeploy: "${{ inputs.Image }}:${{ inputs.ImageTag }}"
        acrName: ${{vars.ACR_REGISTERY_NAME}}
        containerAppName: ${{vars.CONTAINER_APP_NAME}}
        resourceGroup: "${{ inputs.RG }}"
        acrUsername: ${{ secrets.acrUserName }}
        acrPassword: ${{ secrets.acrPassword }}
        yamlConfigPath: ${{ github.workspace }}/set-container-name.yaml

And set-container-name.yaml file is like below:

properties:
template:
containers:
- name: be-container

I don't know whether this mixed usage allowed or not that I need to put everything in a yaml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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