@@ -168,6 +168,43 @@ param enableTelemetry bool = true
168168@description ('Required. Suffix for resource naming.' )
169169param resourceSuffix string
170170
171+ // VM Size Notes:
172+ // 1 B-series VMs (like Standard_B2ms) do not support accelerated networking.
173+ // 2 Pick a VM size that does support accelerated networking (the usual jump-box candidates):
174+ // Standard_DS2_v2 (2 vCPU, 7 GiB RAM, Premium SSD) // The most broadly available (it’s a legacy SKU supported in virtually every region).
175+ // Standard_D2s_v3 (2 vCPU, 8 GiB RAM, Premium SSD) // next most common
176+ // Standard_D2s_v4 (2 vCPU, 8 GiB RAM, Premium SSD) // Newest, so fewer regions availabl
177+
178+
179+ // Subnet Classless Inter-Doman Routing (CIDR) Sizing Reference Table (Best Practices)
180+ // | CIDR | # of Addresses | # of /24s | Notes |
181+ // |-----------|---------------|-----------|----------------------------------------|
182+ // | /24 | 256 | 1 | Smallest recommended for Azure subnets |
183+ // | /23 | 512 | 2 | Good for 1-2 workloads per subnet |
184+ // | /22 | 1024 | 4 | Good for 2-4 workloads per subnet |
185+ // | /21 | 2048 | 8 | |
186+ // | /20 | 4096 | 16 | Used for default VNet in this solution |
187+ // | /19 | 8192 | 32 | |
188+ // | /18 | 16384 | 64 | |
189+ // | /17 | 32768 | 128 | |
190+ // | /16 | 65536 | 256 | |
191+ // | /15 | 131072 | 512 | |
192+ // | /14 | 262144 | 1024 | |
193+ // | /13 | 524288 | 2048 | |
194+ // | /12 | 1048576 | 4096 | |
195+ // | /11 | 2097152 | 8192 | |
196+ // | /10 | 4194304 | 16384 | |
197+ // | /9 | 8388608 | 32768 | |
198+ // | /8 | 16777216 | 65536 | |
199+ //
200+ // Best Practice Notes:
201+ // - Use /24 as the minimum subnet size for Azure (smaller subnets are not supported for most services).
202+ // - Plan for future growth: allocate larger address spaces (e.g., /20 or /21 for VNets) to allow for new subnets.
203+ // - Avoid overlapping address spaces with on-premises or other VNets.
204+ // - Use contiguous, non-overlapping ranges for subnets.
205+ // - Document subnet usage and purpose in code comments.
206+ // - For AVM modules, ensure only one delegation per subnet and leave delegations empty if not required.
207+
171208// 1. Create NSGs for subnets
172209// using AVM Network Security Group module
173210// https://github.com/Azure/bicep-registry-modules/tree/main/avm/res/network/network-security-group
@@ -177,7 +214,7 @@ module nsgs 'br/public:avm/res/network/network-security-group:0.5.1' = [
177214 for (subnet , i ) in subnets : if (!empty (subnet .?networkSecurityGroup )) {
178215 name : take ('avm.res.network.network-security-group.${subnet .?networkSecurityGroup .name }.${resourceSuffix }' , 64 )
179216 params : {
180- name : 'nsg-${resourceSuffix }-${ subnet .?networkSecurityGroup .name }'
217+ name : 'nsg-${subnet .?networkSecurityGroup .name }-${ resourceSuffix }'
181218 location : location
182219 securityRules : subnet .?networkSecurityGroup .securityRules
183220 tags : tags
@@ -204,10 +241,6 @@ module virtualNetwork 'br/public:avm/res/network/virtual-network:0.7.0' = {
204241 privateEndpointNetworkPolicies : subnet .?privateEndpointNetworkPolicies
205242 privateLinkServiceNetworkPolicies : subnet .?privateLinkServiceNetworkPolicies
206243 delegation : subnet .?delegation
207- routeTableResourceId : subnet .?routeTableResourceId
208- serviceEndpointPolicies : subnet .?serviceEndpointPolicies
209- serviceEndpoints : subnet .?serviceEndpoints
210- defaultOutboundAccess : subnet .?defaultOutboundAccess
211244 }
212245 ]
213246 diagnosticSettings : [
0 commit comments