Skip to content

Error: argument targetPort only works if the container app does not exist yet #105

Open
@konsti

Description

When you set the targetPort argument in the GitHub Action for deploying Container Apps on Azure, the initial deployment succeeds, but subsequent updates fail.

Here's an example configuration that triggers the issue:

- name: Deploy Container App
  uses: azure/container-apps-deploy-action@v2
  with:
    containerAppName: test-app
    resourceGroup: [...resourceGroup]
    imageToDeploy: [...imageUrl]
    targetPort: 8080

Identified Issue:

The root of the problem seems to be the Azure CLI command az containerapp update, which lacks support for the target-port argument. Consequently, this Action defaults to using the up command for both initial deployments and updates. However, if the app is already running, attempting an update with the up command and a specified target-port results in a Forbidden error:

/usr/bin/az containerapp up [...] --target-port 8080
ERROR: Operation returned an invalid status 'Forbidden'

As the ingress setup is only needed during creation, this Action should skip the targetPort and only update the container or (if specified) delete and re-create the container if the targetPort changed

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions