Share via

I have a managed application that does not want to be deleted

Niels Willems 31 Reputation points
2026-05-12T13:19:47.53+00:00

There is a container instance left that cannot be removed, because it does not exists. Please follow up in DM.

Azure Container Instances
0 comments No comments

1 answer

Sort by: Most helpful
  1. Himanshu Shekhar 6,420 Reputation points Microsoft External Staff Moderator
    2026-05-12T13:25:32.3733333+00:00

    Hey Niels, it sounds like you’ve got a “ghost” container instance hanging around in your managed app that you can’t delete because it doesn’t appear to actually exist anymore. This usually happens when the platform’s delete operation gets stuck or an identity/key it depended on was removed first. Here’s a process you can try:

    1. Verify what the platform actually knows about that container • Run in Azure CLI: az container list --resource-group <your-managedapp-rg> --output table • Or use Resource Explorer (https://resources.azure.com/) and drill into /subscriptions/<subID>/resourceGroups/<your-managedapp-rg>/providers/Microsoft.ContainerInstance/containerGroups If you see your container in one of these views, note its full resource ID.
    2. Try a forced delete by resource ID • In Azure CLI: az container delete --ids /subscriptions/.../resourceGroups/.../providers/Microsoft.ContainerInstance/containerGroups/<name> --yes • Wait a few minutes and re-run az container list to confirm removal.
    3. If it still won’t go away, re-create & delete trick (From the “ACI still running after stop or delete” doc) • Deploy a new container group using that exact same resource ID (name + region + RG) • Once provisioning succeeds, delete it again – the platform cleanup often kicks in properly this time.
    4. Check for dependent identities or keys (From the “container group is in a bad state” doc) • Did you delete any managed identity or a customer-managed key before the container? • If yes, recover the identity or Key Vault key (soft-delete) so the service can authenticate and finish the delete. •
    5. Then delete the container group first, wait for it to finish, and finally remove the identity/key if you still don’t need it.

    If none of the above works, open a support ticket The backend may need a manual nudge to clear stuck resources.

    Reference list

    1. Azure container instance continues to run after the stop or delete command https://learn.microsoft.com/troubleshoot/azure/azure-container-instances/management/aci-still-running-after-stop-delete-command
    2. Can’t do operations or the container group is in a bad state https://learn.microsoft.com/troubleshoot/azure/azure-container-instances/management/cannot-do-container-group-operations
    3. Quickstart: Deploy a container instance in Azure using the Azure CLI (cleanup steps) https://learn.microsoft.com/azure/container-instances/container-instances-quickstart?wt.mc_id=knowledgesearch_inproduct_azure-cxp-community-insider#clean-up-resources

    . If you have any further queries, let me know. If the information is helpful, please click on Upvote and Accept Answer on it.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.