Azure / container-apps-deploy-action

GitHub Action for building and deploying Azure Container Apps
MIT License
52 stars 29 forks source link

containerapp job support #92

Open acidbubbles opened 9 months ago

acidbubbles commented 9 months ago

I would like to deploy a containerapp job. I initially tried using the parameters but it runs az containerapp create, but for jobs it should be az containerapp job create.

I also tried with yaml but it crashed with ERROR: Containerapp type must be "Microsoft.App/ContainerApps".

Am I to understand that containerapp jobs are not supported? I was surprised that there were no indications about jobs whatsoever, and in https://learn.microsoft.com/en-us/azure/container-apps/azure-resource-manager-api-spec?tabs=yaml#container-app-examples (referenced in the README) jobs seem to be referenced.

I would like to either:

  1. See clearly if containerapp jobs are not supported, in which case an alternative would be appreciated, or;
  2. Give a working example of how to configure containerapp jobs in this action

Thanks!

https://learn.microsoft.com/en-us/azure/container-apps/jobs?tabs=azure-cli

arupnayak commented 3 months ago

I need this as well. There is no way to auto deploy container app jobs via git hub actions. Any help would be appreciated.

imothee commented 3 months ago

Just as an fyi I needed this as well and fell back to using the az cli directly. You can create/update your container jobs using it, instead of using

- name: Deploy to container-apps
        uses: azure/container-apps-deploy-action@v1
        with:
          acrName: ${{ env.acr }}
          containerAppName: ${{ env.container_app }}
          resourceGroup: ${{ env.resource_group }}
          imageToDeploy: ${{ env.login_server }}/${{ env.image }}:${{ github.sha }}

you can use

- name: Deploy to container-apps-jobs
        uses: azure/cli@v2
        with:
          azcliversion: latest
          inlineScript: |
            az containerapp job update -n ${{ env.container_app }}-cron -g ${{ env.resource_group }} --image ${{ env.login_server }}/${{ env.image }}:${{ github.sha }}

Not great but should unblock you at least