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: argument targetPort only works if the container app does not exist yet #105

Open
konsti opened this issue Apr 4, 2024 · 0 comments

Comments

@konsti
Copy link

konsti commented Apr 4, 2024

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

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

1 participant