Unable to delete virtual network

Luca Perico 21 Reputation points
2020-10-07T13:39:53.313+00:00

Hi, in the past days I created a Virtual Network with 2 subnets, one of the two containing an Azure Container Instance.
I then deleted the ACI, and I now need to delete the VNet as well.
When I try to delete it, I get this error:

Subnet BackendServersSunet is in use by /subscriptions/{...}/resourceGroups/{...}ResourceGroup/providers/Microsoft.Network/networkProfiles/{...}/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/ipconfigprofile1 and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See aka.ms/deletesubnet.

even if that ipconfigureprofile does not exist anymore. How can I delete it?

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,595 questions
0 comments No comments
{count} votes

Accepted answer
  1. suvasara-MSFT 10,056 Reputation points
    2020-10-07T14:06:37.223+00:00

    @Luca Perico , Please try these CLI commands to delete the network profile,

    NETWORK_PROFILE_ID=$(az network profile list --resource-group yourResourceGroup --query [0].id --output tsv)  
    az network profile delete --id $NETWORK_PROFILE_ID -y  
    

    After deleting this profile, you can then delete your VNET. Let us know if the above solution doesn't work in your case for further analysis.

    ----------

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

    4 people found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Robert Marcinkiewicz 11 Reputation points
    2021-06-14T08:35:30.337+00:00

    I've found it:

    1. In the Azure portal, go to the resource group's Overview page
    2. In the header for the list of the resource group's resources, select Show hidden types. The network profile type is hidden in the Azure portal by default
    2 people found this answer helpful.

  2. Leon Laude 85,861 Reputation points
    2020-10-07T13:43:09.357+00:00

    HI @Luca Perico ,

    Did you go through the following documentation?

    Troubleshooting: Failed to delete a virtual network in Azure
    https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-troubleshoot-cannot-delete-vnet

    ----------

    (If the reply was helpful please don't forget to upvote or accept as answer, thank you)

    Best regards,
    Leon


  3. Robert Marcinkiewicz 11 Reputation points
    2021-06-14T07:06:45.9+00:00

    Is the network profile also available in the Azure portal ?

    0 comments No comments

Your answer

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