How can I check all the resources which are connected to the virtual sub-net?

Ash J 20 Reputation points
2024-05-11T10:12:16.1933333+00:00

When I am trying to modify a virtual sub-net it is giving an error message stating it is in use. I have validated all the resources and not able to narrow down to this sub-net.

Any help will be greatly appreciated.

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,202 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jackson Martins 9,801 Reputation points MVP
    2024-05-11T10:18:20.7166667+00:00

    Hi @Ash J

    Sometimes services like Network Interfaces, Virtual Machines, Gateways, or even Azure services that automatically create hidden connections (like Azure Container Instances) might still be associated with the subnet.

    https://learn.microsoft.com/en-us/troubleshoot/azure/azure-container-instances/connectivity/cannot-delete-vnet-subnet#workaround-delete-the-service-association-link

    Remove subnet delegation from an Azure service:
    In the search box at the top of the portal, enter Virtual network. Select Virtual networks in the search results.

    Select vnet-1.

    Select Subnets in Settings.

    Select subnet-1.
    User's image

    You can use Azure CLI to list resources that might be associated with the subnet. Run a command similar to the following to find any network interfaces still linked:

    az network nic list --query "[?ipConfigurations.subnet.id=='/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Network/virtualNetworks/{vnet-name}/subnets/{subnet-name}']"
    

    Replace {sub-id}, {rg}, {vnet-name}, and {subnet-name} with your actual subscription ID, resource group, virtual network, and subnet names.

    This is a tool provided by Azure to explore deeper into the resources. You might find some hidden links here. It's available at resources.azure.com.

    Get in touch if you need more help with this issue.

    --please don't forget to "[Accept the answer]" if the reply is helpful--

    0 comments No comments

0 additional answers

Sort by: Most helpful