Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
I understand that you would like to deploy a subnet to an existing VNET using Bicep without disrupting the existing subnet configurations.
Yes, this is doable.
You can use the below bicep configuration example to achieve this.
var subnetName = 'newSubnet'
var vnetName = 'vnet'
resource myvnet 'Microsoft.Network/virtualNetworks@2023-04-01' existing = {
name: vnetName
}
resource subnet 'Microsoft.Network/virtualNetworks/subnets@2023-04-01' = {
name: subnetName
parent: myvnet
properties:{
addressPrefix:'10.0.20.0/24' //Address prefix should **not** be overlapping with existing subnets
}
}
Thanks,
Kapil
Please Accept an answer if correct.
Original posters help the community find answers faster by identifying the correct answer.