Azure/container-apps-deploy-action

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

Opened this issue ยท 13 comments

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.

+1, just ran into the same issue

@cormacpayne will it be possible to assign someone to this issue?

This seems like a blocker for us using this action as it doesn't seem to support multiple containers in one app.

PR #79 is open for this to be supported but hasn't had anyone look at it. Is this action still under support?

@dchecks We've been doing a significant push to rewrite the Github Action in TypeScript, and I believe we should be close from making it the new default.
@cormacpayne Looking at the PR it looks like something we could easily integrate in the new TypeScript action. Would you see an issue with that?

Anyone tracking this? It's definitely broken and blocking CI/CD using this action.

action.yml has no --container-name anything. these guys have abandoned this effort.

multi-container replica sets are not supported.

thanks, Azure ๐Ÿ™„

+1

I'm attempting to deploy our code to an Azure Container App via pipeline and encountering this error - I'd rather not have to use CLI commands for this.

Any ETA on this?

if you already have a workflow file drafted and you're looking for multi-container support, this is what i did.

assumptions are that you have your build done and you're pushing tags to your image repo in a previous job (in my case, i did it in my init job)

...
...
...
  deploy:
    runs-on: ubuntu-latest
    environment: dev
    needs: [init, build]
    steps:
      - 
        name: Azure Login
        uses: azure/login@v2
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS }}
      -
        name: Deploy via az cli
        uses: azure/CLI@v2
        with:
          azcliversion: 2.61.0
          inlineScript: |
            az extension add --name containerapp --upgrade --allow-preview true --only-show-errors
            az provider register --namespace Microsoft.App --only-show-errors
            replicaset_containers=$(\
              az containerapp show --name ${{ env.ACA }} \
                  --resource-group ${{ env.RG }} \
                  --query 'properties.template.containers[*].name' \
                  --output tsv \
                  --only-show-errors \
                  )
            for container in $replicaset_containers; do
              az containerapp update \
                --resource-group ${{ env.RG }} \
                --name ${{ env.ACA }} \
                --container-name $container \
                --image ${{ needs.init.outputs.tag }} \
                --only-show-errors
            done

good luck.

Is there any more effort happening to fix this Action? Thanks,