Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
canserhat77 opened this issue Oct 2, 2023 · 13 comments

Comments

@canserhat77
Copy link

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.

@canserhat77 canserhat77 changed the title Passing image name to the yaml file. ERROR: Usage error: --container-name is required when adding or updating a container. Oct 10, 2023
@magom001
Copy link

+1, just ran into the same issue

@magom001
Copy link

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

@rbjoergensen
Copy link

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

@CodinMoldovanu
Copy link

+1

@dchecks
Copy link

dchecks commented Jan 8, 2024

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

@daniv-msft
Copy link
Contributor

@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?

@kevintupper
Copy link

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

@camilosantana
Copy link

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

multi-container replica sets are not supported.

thanks, Azure 🙄

@fritzfs
Copy link

fritzfs commented May 29, 2024

+1

@rrussell0
Copy link

rrussell0 commented May 29, 2024

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.

@matt-erhart
Copy link

Any ETA on this?

@camilosantana
Copy link

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.

@jolguk
Copy link

jolguk commented Sep 10, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests