Support auto-delete of ACI when container exits normally
When an ACI container exits normally and the restart-policy is Never you should automatically delete the ACI. Currently it sticks around with a status of Terminated.
In my scenario I want to spin up ACI's to drain an Azure queue. When the queue is empty my ACI workers will exit and I do not want to have to go and clean up the ACI remnants afterwards. They should cleanly remove themselves as if they never existed.
This can be an option if there are scenarios where this is undesirable.
AdminACI Team (Admin, Microsoft Azure) commented
Leaving your container group in a terminated state gives you access to the logs and platform events (even if you haven't configured Log Analytics), while not accruing additional cost.
What do you perceive as the benefits from auto-deletion of container groups? Ease of clean-up?
Kunal Babre commented
I feel this is important scenerio, a property during deployment to explicitly ask delete on exit would be perfect. Also similar logic would benefit Failed ACIs.
Tobias Zimmergren commented
This is a scenario that keeps coming up more and more. I'm also looking for this capability, and currently have to deploy -another- set of resources (Functions, another ACI, Web Job,...) to check if the jobs/tasks the ACI are working on are done, and if so I delete the ACI. It still means I have a Function/WebJob/some-type-of-orchestrator logic in place to ensure the cleanup.
I've heard this several times echoed in the community as well, and it would indeed be helpful to have a new restart policy for this.