azure-dev icon indicating copy to clipboard operation
azure-dev copied to clipboard

[Feature] Support for deploying App Container Jobs

Open Digma opened this issue 2 years ago • 7 comments

It is not possible to deploy App Container Jobs (Microsoft.App/jobs, Container App jobs) with azd deploy

Output from azd version

ERROR: failed deploying service 'SERVICE_NAME': failing invoking action 'deploy', validating target resource: resource 'CONTAINER_APP_JOB_NAME' with type 'Microsoft.App/jobs' does not match expected resource type 'Microsoft.App/containerApps'

Describe the bug We are building some container jobs to consume and process events from AzureEventGrid. Container Jobs seem great for that but unfortunately, the deployment of containers is not supported today by azd without workarounds

To Reproduce Create a 'Microsoft.App/jobs' resource and try to deploy an docker image with azd deploy (azure.yml, is configured as host: containerapp)

Expected behavior It is possible to deploy to container app jobs using azd deploy, potentially by specifying a different host in azure.yml

Digma avatar Sep 14 '23 09:09 Digma

Similar to #2665. Interested in what other workflow you might have around this, @Digma? Would you expect a way to run the job via azd? Do you have some other strategy for invoking them (i.e. perhaps they are doing background work for an app and launched by your app itself)

ellismg avatar Sep 14 '23 17:09 ellismg

Indeed similar to #2665. It sems my search missed it. Feel free to close if this is a duplicate

In general, we like working with containers for our different apps and pipelines. For that example, we have some file processing pipeline which is triggered by a queue linked with events on a blob storage (EventGrid). Given files do not get updated all the time, the container app job allow us to easily run only when needed (when there are events in the queue).

Our current workaround is to not use azd provision and have a script to build and push the containers before the provisioning of the infra

Digma avatar Sep 15 '23 07:09 Digma

This would be useful for me also. I think keeping host: containerapp and this host type supports jobs. Just my 2c...

ianphil avatar Apr 02 '24 14:04 ianphil

It would be great if jobs were supported. common pattern fort short lived containers and having it done by AZD would make creating demos/POCs much easier

karpikpl avatar Oct 30 '24 16:10 karpikpl

Hi team, do you have any updates on when this feature might be added? Are there any workarounds available now to include a container app job as a service?

amgdy avatar Dec 14 '24 16:12 amgdy

Hi team, do you have any updates on when this feature might be added? Are there any workarounds available now to include a container app job as a service?

As a workaround, I used the postprovision hook to run a script to build and push container to the ACR then update the container app job with the new image, and I disabled/removed the services section until the feature is available.

Here is the relevant section from my azure.yaml:

name: azure-ai-search-website-crawler
metadata:
    template: [email protected]

hooks:
    postprovision:
        windows:
            shell: pwsh
            continueOnError: false
            interactive: true
            run: ./scripts/Deploy-AzureContainerAppJob.ps1
        posix:
            shell: sh
            continueOnError: false
            interactive: true
            run: ./scripts/deploy-azure-container-app-job.sh

You can view azure.yaml, deploy-azure-container-app-job.sh and Deploy-AzureContainerAppJob.ps1 for more details.

amgdy avatar Dec 17 '24 09:12 amgdy

This issue has been automatically marked as stale because it has not had any activity in the last year!!, and it will be closed in 30 days if no further activity occurs.

If you think this is a mistake, please comment on this issue to keep it open.

github-actions[bot] avatar Dec 18 '25 03:12 github-actions[bot]

Let's keep this open. This is still something we want for ACA

vhvb1989 avatar Dec 23 '25 20:12 vhvb1989