22// Networking - NSGs, VNET and Subnets. Each subnet has its own NSG
33/****************************************************************************************************************************/
44@description ('Name of the virtual network.' )
5- param name string
5+ param name string
66
77@description ('Azure region to deploy resources.' )
88param location string = resourceGroup ().location
@@ -15,7 +15,7 @@ param subnets subnetType[] = [
1515 {
1616 name : 'web'
1717 addressPrefixes : ['10.0.0.0/23' ] // /23 (10.0.0.0 - 10.0.1.255), 512 addresses
18- delegation : 'Microsoft.Web/serverFarms '
18+ delegation : 'Microsoft.App/environments '
1919 networkSecurityGroup : {
2020 name : 'nsg-web'
2121 securityRules : [
@@ -41,8 +41,8 @@ param subnets subnetType[] = [
4141 protocol : '*'
4242 sourcePortRange : '*'
4343 destinationPortRange : '*'
44- sourceAddressPrefixes : ['10.0.0.0/23' ]
45- destinationAddressPrefixes : ['10.0.0.0/23' ]
44+ sourceAddressPrefixes : ['10.0.0.0/23' ] // From same subnet
45+ destinationAddressPrefixes : ['10.0.0.0/23' ] // To same subnet
4646 }
4747 }
4848 {
@@ -280,10 +280,18 @@ output subnets subnetOutputType[] = [
280280]
281281
282282// Dynamic outputs for individual subnets for backward compatibility
283- output webSubnetResourceId string = contains (map (subnets , subnet => subnet .name ), 'web' ) ? virtualNetwork .outputs .subnetResourceIds [indexOf (map (subnets , subnet => subnet .name ), 'web' )] : ''
284- output pepsSubnetResourceId string = contains (map (subnets , subnet => subnet .name ), 'peps' ) ? virtualNetwork .outputs .subnetResourceIds [indexOf (map (subnets , subnet => subnet .name ), 'peps' )] : ''
285- output bastionSubnetResourceId string = contains (map (subnets , subnet => subnet .name ), 'AzureBastionSubnet' ) ? virtualNetwork .outputs .subnetResourceIds [indexOf (map (subnets , subnet => subnet .name ), 'AzureBastionSubnet' )] : ''
286- output jumpboxSubnetResourceId string = contains (map (subnets , subnet => subnet .name ), 'jumpbox' ) ? virtualNetwork .outputs .subnetResourceIds [indexOf (map (subnets , subnet => subnet .name ), 'jumpbox' )] : ''
283+ output webSubnetResourceId string = contains (map (subnets , subnet => subnet .name ), 'web' )
284+ ? virtualNetwork .outputs .subnetResourceIds [indexOf (map (subnets , subnet => subnet .name ), 'web' )]
285+ : ''
286+ output pepsSubnetResourceId string = contains (map (subnets , subnet => subnet .name ), 'peps' )
287+ ? virtualNetwork .outputs .subnetResourceIds [indexOf (map (subnets , subnet => subnet .name ), 'peps' )]
288+ : ''
289+ output bastionSubnetResourceId string = contains (map (subnets , subnet => subnet .name ), 'AzureBastionSubnet' )
290+ ? virtualNetwork .outputs .subnetResourceIds [indexOf (map (subnets , subnet => subnet .name ), 'AzureBastionSubnet' )]
291+ : ''
292+ output jumpboxSubnetResourceId string = contains (map (subnets , subnet => subnet .name ), 'jumpbox' )
293+ ? virtualNetwork .outputs .subnetResourceIds [indexOf (map (subnets , subnet => subnet .name ), 'jumpbox' )]
294+ : ''
287295
288296@export ()
289297@description ('Custom type definition for subnet resource information as output' )
@@ -307,8 +315,8 @@ type subnetType = {
307315 @description ('Required. The Name of the subnet resource.' )
308316 name : string
309317
310- @description ('Required. Prefixes for the subnet.' ) // Required to ensure at least one prefix is provided
311- addressPrefixes : string []
318+ @description ('Required. Prefixes for the subnet.' ) // Required to ensure at least one prefix is provided
319+ addressPrefixes : string []
312320
313321 @description ('Optional. The delegation to enable on the subnet.' )
314322 delegation : string ?
0 commit comments