Home > Net >  Stop an Azure ContainerApp?
Stop an Azure ContainerApp?

Time:09-18

I have an Azure ContainerApp deployed with a single revision, and I'd like to stop it - but not delete it and have to re-deploy it. I see the image in the registry, and there are options via the portal to deploy it to an AppService or ContainerInstance, but not to a ContainerApp.

I also have looked through the az CLI, specifically Revisions

Save Revisions

CodePudding user response:

You can deactivate a revision to shut down the containers. If you deactivate all active revisions, you will effectively stop your containerapp.

https://learn.microsoft.com/en-us/azure/container-apps/application-lifecycle-management

Once a revision is no longer needed, you can deactivate a revision with the option to reactivate later. During deactivation, containers in the revision are shut down.

When you need it again, you can use activate to get new replicas.

az containerapp revision deactivate --resource-group
                                    --revision
                                    [--name]

az containerapp revision activate --resource-group
                                  --revision
                                  [--name]

If you visit the containerapp url after deactivating all revisions, you will receive an error:

Error 403 - This Container App is stopped.

  • Related