When creating resources like virtual networks with subnets, I often want to refer to the subnet resource ID in another resource or as an output. Because the subnet property of the VNet is an array, the way I can reference that today is:
vnet.properties.subnets[0].id
I don't like this, because it is brittle to changes in the ordering of the subnets. What I'd love to be able to do instead is something like this:
vnet.properties.subnets[vmSubnetName].id
Currently the workaround I'm using is to use the resourceId() function directly, but it'd be nicer if Bicep supported this using the symbolic referencing syntax.
When creating resources like virtual networks with subnets, I often want to refer to the subnet resource ID in another resource or as an output. Because the subnet property of the VNet is an array, the way I can reference that today is:
I don't like this, because it is brittle to changes in the ordering of the subnets. What I'd love to be able to do instead is something like this:
Currently the workaround I'm using is to use the
resourceId()function directly, but it'd be nicer if Bicep supported this using the symbolic referencing syntax.