Similar to the virtual network address space, we can change the size of a subnet at any time.
Changing the subnet size
Getting ready
Before you start, open a web browser and go to the Azure portal at https://portal.azure.com.
How to do it...
In order to change subnet size using the Azure portal, we must use the following steps:
- In a virtual network blade, select the Subnets option.
- Select the subnet you want to change.
- In the Subnets option, enter a new value for the subnet size under Address range. An example of how to do this is shown in the following screenshot:
- After entering a new value, click on Save.
- In the Subnets list, you can see the changes applied and the address space has changed, as shown in the following screenshot:
How it works...
When changing subnet size, there are some rules that must be followed. You can't change the address space if it's not within the virtual network address space range and the subnet range can't overlap with other subnets in a virtual network. If devices are assigned to this subnet, you can't change the subnet to exclude the addresses that these devices are already assigned to.