Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
From your verbatim, I see you noticed Virtual Networks - Get REST API is returning "subnets" as a list.
- This is expected
- subnets is supposed to be a list only, see Microsoft.Network virtualNetworks ARM Template
I take it that, you are actually concerned about the "subnets.properties.addressPrefix" and "subnets.properties.addressPrefixes"
- Can you confirm
- If this is same results with a particular Subnet
- or even with a particular Subnet, sometimes you are getting a list and sometimes you are not
- The former is also an expected behavior
- From the "Export Template" blade of the Virtual Network - you would notice that the certain VNETs would have subnets' address range as addressPrefixes while others have addressPrefix
- This is because of the recent changes in the creation of VNET with Portal
- Newer VNETs would use addressPrefixes
- While older VNETs would use addressPrefix
- This also depends on how the VNET was created via Template or CLI or Powershell
In case you notice a particular Subnet sometimes returning addressPrefix and sometimes returning addressPrefixes, we can look into this.
Thanks,
Kapi
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.