Can not update addresses prefix of a subnet due to resources being used

Raffaele Piccolo 26 Reputation points
2021-02-24T11:03:26.11+00:00

Hello,

I've recently created a container instance deploying it to an existing virtual network with an only one subnet, since the creation of a container instance change the delegation of the subnet the problem is that I'm not able to attach that subnet to other resources using the same virtual network due to delegation problem.
My scenario is:

  • The subnet in the virtual network use the whole address space of the virtual network (this is because we did not think about adding any other resources but virtual machines)
  • I wanted to deploy a container but had to change subnet's delegation and move the resources connected to the subnet
  • I wanted to change the addresses prefix so that I would be able to create more subnets but obtained an error from the Azure portal telling me that the subnet is being used by a resource (container)
  • Removed the container and tried again to change addresses prefix of previous subnet
  • Received the same error (subnet is being used by a resource) even though I've deleted the container

My question is do I have to delete the Virtual Network and recreate it (using different subnets) or there's a way to update the just the subnets configuration?

Thanks in advance for you answers,
Greetings,
Raffaele Piccolo

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
700 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. vipullag-MSFT 26,306 Reputation points
    2021-02-26T05:33:27.727+00:00

    anonymous user

    Apologies in delayed response.

    Have you tried the steps described in ACI’s Virtual Network documentation. In addition to deleting the container group, you must also delete the network profile to unblock the subnet/Vnet deletion.

    After the network profile and container group have been successfully deleted, you can modify or delete the subnet.

    Hope this helps.

    Please 'Accept as answer' if the provided information is helpful, so that it can help others in the community looking for help on similar topics.


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.