Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete a revision in Azure Container Apps?

Is there a way to delete a revision on Azure Container Apps?

Scenario

I have an Azure Container App instance for testing puposes which I regularly push new revisions to using the az containerapp update command in my CI/ CD pipeline whenever I merge a change onto my master branch. As the revisions all use a Docker image with the same tag :latest - but not (necessarily) the same code inside the Docker container - I create a new unique revision suffix for each revision in order to create a revision-scope change.

I am using the single-revision mode, therefore there's only ever one revision which serves 100% of the traffic. So whenever I push a new revision with a new revision-suffix a new revision gets created and activated and the previous revision gets deactivated.

Using this approach with time a lot of revisions get created and most of them will not be needed anymore but will still occupy storage and - as revision names must be unqiue - a lot of names which I would like to re-use, therefore I'd like to delete them.

However, looking at the available commands in the Azure CLI for revisions there does not seem to be a way to delete a revision.

The question therefore is, if there is a way how can I delete those revisions? Alternatively if revisions cannot be deleted, is there another way so I can force the container app to update the docker image it is running even though the tag of the docker image does not change (in that case I would not (necessarily) need to create a new revision every time)?

Expectation

I would have expected there was a deletion command as there will be many container apps with many revisions which will need lots of storage (which one might need to pay for eventually) as a revision might be activated again at any time, so Microsoft or Azure users should at least to my mind have the same desire to delete outdated/ deprecated/ unused revisions.

like image 601
Mushroomator Avatar asked Sep 02 '25 06:09

Mushroomator


1 Answers

Agreed the point of @ahmelsayed that is not possible to delete the revisions manually and they should eventually be pruned to the most recent 100.

I would have expected there was a deletion command as there will be many container apps with many revisions which will need lots of storage (which one might need to pay for eventually) as a revision might be activated again at any time, so Microsoft or Azure users should at least to my mind have the same desire to delete outdated/ deprecated/ unused revisions.

As mentioned in this MS Doc, max. 100 revisions are allowed and older than that are purged where there is no cost for inactive revisions.

You can deactivate the unused or outdated revisions using the Azure Portal or Azure CLI or REST API or Code like Java, Go, and JS and activate also.

Here is the syntax of deactivating the Azure Container Apps Revisions using Azure CLI:

az containerapp revision deactivate --revision <Your_Container_Revision_Name> --resource-group <Your_Resource-Group_Name>

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!