Can not delete aci network profile

Ihsen Alaya 110 Reputation points
2025-08-23T16:55:16.5933333+00:00

I’m trying to delete the network profile aci-networkProfile-eastus
The az network profile delete command returns the error:
(NetworkProfileAlreadyInUseWithContainerNics) Network profile ... is already in use with container nics ..._eth-cloudshellsubnet; cannot update or delete. This network profile was created by following the official Microsoft documentation for deploying Cloud Shell integrated into a virtual network (VNet): https://dori-uw-1.kuma-moon.com/en-us/azure/cloud-shell/vnet/deployment

The issue is that the container NIC is associated with a container group in another subscription that does not belong to my tenant. This container group does not exist in my environment, which blocks the deletion.

Expected result: Be able to delete the orphaned network profile :)

Azure Container Instances
0 comments No comments
{count} votes

Answer accepted by question author
  1. Vinodh247 40,221 Reputation points MVP Volunteer Moderator
    2025-08-24T04:41:41.7833333+00:00

    I believe this issue occurs because the network profile you are trying to delete is still referencing an orphaned container NIC that Azure believes is in use, even though the actual container group no longer exists. To resolve this, first inspect the resource using az resource show --ids <networkProfileID> to identify the NICs linked to the profile. If you find orphaned NICs, delete them manually with az resource delete --ids <containerNicResourceId>, and then retry deleting the network profile. If the CLI still fails, use the Azure restAPI with a direct DELETE request to the network profile endpoint. In cases where the error is caused by a cross-subscription reference, verify if the NIC resource truly exists using az resource show; if it returns ResourceNotFound, it is safe to force-delete the profile. If none of these methods work, raise a support request. To prevent this in the future, always delete the container instances first before removing the network profile, and avoid creating cross-subscription dependencies without proper lifecycle management.


0 additional answers

Sort by: Most helpful

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.