@@ -272,6 +272,7 @@ resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
272272 TemplateName : 'Client Advisor'
273273 Type : enablePrivateNetworking ? 'WAF' : 'Non-WAF'
274274 CreatedBy : createdBy
275+ DeploymentName : deployment ().name
275276 }
276277 }
277278}
@@ -386,22 +387,109 @@ module sqlUserAssignedIdentity 'br/public:avm/res/managed-identity/user-assigned
386387 }
387388}
388389
389- // ========== Network Module ========== //
390- module network 'modules/network.bicep' = if (enablePrivateNetworking ) {
391- name : take ('network-${solutionSuffix }-deployment' , 64 )
390+ // ========== Virtual Network and Networking Components ========== //
391+
392+ // Virtual Network with NSGs and Subnets
393+ module virtualNetwork 'modules/virtualNetwork.bicep' = if (enablePrivateNetworking ) {
394+ name : take ('module.virtualNetwork.${solutionSuffix }' , 64 )
392395 params : {
393- resourcesName : solutionSuffix
394- // logAnalyticsWorkSpaceResourceId: logAnalyticsWorkspace.outputs.resourceId
395- logAnalyticsWorkSpaceResourceId : logAnalyticsWorkspaceResourceId
396- vmAdminUsername : vmAdminUsername ?? 'JumpboxAdminUser'
397- vmAdminPassword : vmAdminPassword ?? 'JumpboxAdminP@ssw0rd1234!'
398- vmSize : vmSize ?? 'Standard_DS2_v2' // Default VM size
396+ name : 'vnet-${solutionSuffix }'
397+ addressPrefixes : ['10.0.0.0/20' ] // 4096 addresses (enough for 8 /23 subnets or 16 /24)
399398 location : solutionLocation
400399 tags : allTags
400+ logAnalyticsWorkspaceId : logAnalyticsWorkspaceResourceId
401+ resourceSuffix : solutionSuffix
402+ enableTelemetry : enableTelemetry
403+ }
404+ }
405+ // Azure Bastion Host
406+ var bastionHostName = 'bas-${solutionSuffix }'
407+ module bastionHost 'br/public:avm/res/network/bastion-host:0.6.1' = if (enablePrivateNetworking ) {
408+ name : take ('avm.res.network.bastion-host.${bastionHostName }' , 64 )
409+ params : {
410+ name : bastionHostName
411+ skuName : 'Standard'
412+ location : solutionLocation
413+ virtualNetworkResourceId : virtualNetwork !.outputs .resourceId
414+ diagnosticSettings : [
415+ {
416+ name : 'bastionDiagnostics'
417+ workspaceResourceId : logAnalyticsWorkspaceResourceId
418+ logCategoriesAndGroups : [
419+ {
420+ categoryGroup : 'allLogs'
421+ enabled : true
422+ }
423+ ]
424+ }
425+ ]
426+ tags : tags
401427 enableTelemetry : enableTelemetry
428+ publicIPAddressObject : {
429+ name : 'pip-${bastionHostName }'
430+ zones : []
431+ }
402432 }
403433}
404434
435+ // Jumpbox Virtual Machine
436+ var jumpboxVmName = take ('vm-jumpbox-${solutionSuffix }' , 15 )
437+ module jumpboxVM 'br/public:avm/res/compute/virtual-machine:0.15.0' = if (enablePrivateNetworking ) {
438+ name : take ('avm.res.compute.virtual-machine.${jumpboxVmName }' , 64 )
439+ params : {
440+ name : take (jumpboxVmName , 15 ) // Shorten VM name to 15 characters to avoid Azure limits
441+ vmSize : vmSize ?? 'Standard_DS2_v2'
442+ location : solutionLocation
443+ adminUsername : vmAdminUsername ?? 'JumpboxAdminUser'
444+ adminPassword : vmAdminPassword ?? 'JumpboxAdminP@ssw0rd1234!'
445+ tags : tags
446+ zone : 0
447+ imageReference : {
448+ offer : 'WindowsServer'
449+ publisher : 'MicrosoftWindowsServer'
450+ sku : '2019-datacenter'
451+ version : 'latest'
452+ }
453+ osType : 'Windows'
454+ osDisk : {
455+ name : 'osdisk-${jumpboxVmName }'
456+ managedDisk : {
457+ storageAccountType : 'Standard_LRS'
458+ }
459+ }
460+ encryptionAtHost : false // Some Azure subscriptions do not support encryption at host
461+ nicConfigurations : [
462+ {
463+ name : 'nic-${jumpboxVmName }'
464+ ipConfigurations : [
465+ {
466+ name : 'ipconfig1'
467+ subnetResourceId : virtualNetwork !.outputs .jumpboxSubnetResourceId
468+ }
469+ ]
470+ diagnosticSettings : [
471+ {
472+ name : 'jumpboxDiagnostics'
473+ workspaceResourceId : logAnalyticsWorkspaceResourceId
474+ logCategoriesAndGroups : [
475+ {
476+ categoryGroup : 'allLogs'
477+ enabled : true
478+ }
479+ ]
480+ metricCategories : [
481+ {
482+ category : 'AllMetrics'
483+ enabled : true
484+ }
485+ ]
486+ }
487+ ]
488+ }
489+ ]
490+ enableTelemetry : enableTelemetry
491+ }
492+ }
405493// ========== Private DNS Zones ========== //
406494var privateDnsZones = [
407495 'privatelink.cognitiveservices.azure.com'
@@ -455,8 +543,8 @@ module avmPrivateDnsZones 'br/public:avm/res/network/private-dns-zone:0.7.1' = [
455543 enableTelemetry : enableTelemetry
456544 virtualNetworkLinks : [
457545 {
458- name : take ('vnetlink-${network !.outputs .vnetName }-${split (zone , '.' )[1 ]}' , 80 )
459- virtualNetworkResourceId : network !.outputs .vnetResourceId
546+ name : take ('vnetlink-${virtualNetwork !.outputs .name }-${split (zone , '.' )[1 ]}' , 80 )
547+ virtualNetworkResourceId : virtualNetwork !.outputs .resourceId
460548 }
461549 ]
462550 }
@@ -496,7 +584,7 @@ module keyvault 'br/public:avm/res/key-vault/vault:0.12.1' = {
496584 ]
497585 }
498586 service : 'vault'
499- subnetResourceId : network !.outputs .subnetPrivateEndpointsResourceId
587+ subnetResourceId : virtualNetwork !.outputs .pepsSubnetResourceId
500588 }
501589 ]
502590 : []
@@ -637,7 +725,7 @@ module aiFoundryAiServices 'modules/ai-services.bicep' = if (aiFoundryAIservices
637725 {
638726 name : 'pep-${aiFoundryAiServicesResourceName }'
639727 customNetworkInterfaceName : 'nic-${aiFoundryAiServicesResourceName }'
640- subnetResourceId : network !.outputs .subnetPrivateEndpointsResourceId
728+ subnetResourceId : virtualNetwork !.outputs .pepsSubnetResourceId
641729 privateDnsZoneGroup : {
642730 privateDnsZoneGroupConfigs : [
643731 {
@@ -744,7 +832,7 @@ module cosmosDb 'br/public:avm/res/document-db/database-account:0.15.0' = {
744832 ]
745833 }
746834 service : 'Sql'
747- subnetResourceId : network !.outputs .subnetPrivateEndpointsResourceId
835+ subnetResourceId : virtualNetwork !.outputs .pepsSubnetResourceId
748836 }
749837 ]
750838 : []
@@ -817,7 +905,7 @@ module avmStorageAccount 'br/public:avm/res/storage/storage-account:0.20.0' = {
817905 }
818906 ]
819907 }
820- subnetResourceId : network !.outputs .subnetPrivateEndpointsResourceId
908+ subnetResourceId : virtualNetwork !.outputs .pepsSubnetResourceId
821909 service : 'blob'
822910 }
823911 {
@@ -830,7 +918,7 @@ module avmStorageAccount 'br/public:avm/res/storage/storage-account:0.20.0' = {
830918 }
831919 ]
832920 }
833- subnetResourceId : network !.outputs .subnetPrivateEndpointsResourceId
921+ subnetResourceId : virtualNetwork !.outputs .pepsSubnetResourceId
834922 service : 'queue'
835923 }
836924 ]
@@ -939,7 +1027,7 @@ module sqlDBModule 'br/public:avm/res/sql/server:0.20.1' = {
9391027 ]
9401028 }
9411029 service : 'sqlServer'
942- subnetResourceId : network !.outputs .subnetPrivateEndpointsResourceId
1030+ subnetResourceId : virtualNetwork !.outputs .pepsSubnetResourceId
9431031 tags : tags
9441032 }
9451033 ]
@@ -1062,7 +1150,7 @@ module webSite 'modules/web-sites.bicep' = {
10621150 // WAF aligned configuration for Private Networking
10631151 vnetRouteAllEnabled : enablePrivateNetworking ? true : false
10641152 vnetImagePullEnabled : enablePrivateNetworking ? true : false
1065- virtualNetworkSubnetId : enablePrivateNetworking ? network !.outputs .subnetWebResourceId : null
1153+ virtualNetworkSubnetId : enablePrivateNetworking ? virtualNetwork !.outputs .webSubnetResourceId : null
10661154 publicNetworkAccess : 'Enabled'
10671155 }
10681156}
@@ -1144,7 +1232,7 @@ module searchService 'br/public:avm/res/search/search-service:0.11.1' = {
11441232 ]
11451233 }
11461234 service : 'searchService'
1147- subnetResourceId : network !.outputs .subnetPrivateEndpointsResourceId
1235+ subnetResourceId : virtualNetwork !.outputs .pepsSubnetResourceId
11481236 }
11491237 ]
11501238 : []
@@ -1381,5 +1469,5 @@ output USE_AI_PROJECT_CLIENT string = useAIProjectClientFlag
13811469@description ('Indicates whether the internal stream should be used.' )
13821470output USE_INTERNAL_STREAM string = useInternalStream
13831471
1384- @description ('The client ID of the managed identity .' )
1385- output AZURE_CLIENT_ID string = userAssignedIdentity . outputs . clientId
1472+ @description ('The Azure Subscription ID where the resources are deployed .' )
1473+ output AZURE_SUBSCRIPTION_ID string = subscription (). subscriptionId
0 commit comments