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.
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.