azureazure-cliazure-container-apps

Deactivating a failed revision in Azure Container Apps deactivates ALL revisions?


I have provisioned a new revision ("aca-failed-revision") in ACA that fails to start. The new revision will be in the Activating runningState for some time until it becomes ActivationFailed. To remove this revision from the resource I used the Azure CLI command: az containerapp revision --deactivate "aca-failed-revision".

Surprisingly, running this command also removes the other active, healthy revision! Is it supposed to be like this? Should I re-deploy the old, healthy revision if the new revision failed to start to have the correct state in ACA?

enter image description here

Edit:


Solution

  • In Azure Container Apps, when using Single Revision Mode, the behavior you observed is expected. In this mode, only one revision can be active at a time.

    When you create a new revision in Single mode, the current healthy revision is automatically deactivated, and the new revision becomes active. If the new revision's state is ActivationFailed and it cannot be deactivated or replaced directly, it remains in an active state with the status Activating or ActivationFailed.

    If the new revision's status is Running, you can activate an inactive revision, and the new revision will be automatically deactivated.

    az containerapp revision deactivate "aca-failed-revision" -g "container-RG"
    

    enter image description here

    Should I re-deploy the old, healthy revision if the new revision failed to start to have the correct state in ACA?

    Yes, in Single Revision Mode, you can't reactivate an old revision. Instead, create a new revision with the same configuration as the old one, which will automatically deactivate the failed revision.

    If you need to create multiple revisions, it is better to use Multiple Revision Mode, which can help avoid downtime and allow manual rollbacks.

    Reference: Unable to set revision label using Azure CLI when running in Single Revision Mode

    Revision modes