@@ -85,6 +85,18 @@ param existingLogAnalyticsWorkspaceId string = ''
8585@description ('Use this parameter to use an existing AI project resource ID' )
8686param existingFoundryProjectResourceId string = ''
8787
88+ @description ('Optional. Size of the Jumpbox Virtual Machine when created. Set to custom value if enablePrivateNetworking is true.' )
89+ param vmSize string ?
90+
91+ @description ('Optional. Admin username for the Jumpbox Virtual Machine. Set to custom value if enablePrivateNetworking is true.' )
92+ @secure ()
93+ param vmAdminUsername string ?
94+
95+ @description ('Optional. Admin password for the Jumpbox Virtual Machine. Set to custom value if enablePrivateNetworking is true.' )
96+ @secure ()
97+ param vmAdminPassword string ?
98+
99+
88100// ========== Variables ========== //
89101var solutionPrefix = 'cps-${padLeft (take (toLower (uniqueString (subscription ().id , environmentName , resourceGroup ().location , resourceGroup ().name )), 12 ), 12 , '0' )}'
90102// ============== //
@@ -353,6 +365,94 @@ module virtualNetwork './modules/virtualNetwork.bicep' = if (enablePrivateNetwor
353365 }
354366}
355367
368+ // Azure Bastion Host
369+ var bastionHostName = 'bas-${solutionPrefix }'
370+ module bastionHost 'br/public:avm/res/network/bastion-host:0.6.1' = if (enablePrivateNetworking ) {
371+ name : take ('avm.res.network.bastion-host.${bastionHostName }' , 64 )
372+ params : {
373+ name : bastionHostName
374+ skuName : 'Standard'
375+ location : resourceGroupLocation
376+ virtualNetworkResourceId : virtualNetwork !.outputs .resourceId
377+ diagnosticSettings : [
378+ {
379+ name : 'bastionDiagnostics'
380+ workspaceResourceId : existingLogAnalyticsWorkspaceId
381+ logCategoriesAndGroups : [
382+ {
383+ categoryGroup : 'allLogs'
384+ enabled : true
385+ }
386+ ]
387+ }
388+ ]
389+ tags : tags
390+ enableTelemetry : enableTelemetry
391+ publicIPAddressObject : {
392+ name : 'pip-${bastionHostName }'
393+ zones : []
394+ }
395+ }
396+ }
397+ // Jumpbox Virtual Machine
398+ var jumpboxVmName = take ('vm-jumpbox-${solutionPrefix }' , 15 )
399+ module jumpboxVM 'br/public:avm/res/compute/virtual-machine:0.15.0' = if (enablePrivateNetworking ) {
400+ name : take ('avm.res.compute.virtual-machine.${jumpboxVmName }' , 64 )
401+ params : {
402+ name : take (jumpboxVmName , 15 ) // Shorten VM name to 15 characters to avoid Azure limits
403+ vmSize : vmSize ?? 'Standard_DS2_v2'
404+ location : resourceGroupLocation
405+ adminUsername : vmAdminUsername ?? 'JumpboxAdminUser'
406+ adminPassword : vmAdminPassword ?? 'JumpboxAdminP@ssw0rd1234!'
407+ tags : tags
408+ zone : 0
409+ imageReference : {
410+ offer : 'WindowsServer'
411+ publisher : 'MicrosoftWindowsServer'
412+ sku : '2019-datacenter'
413+ version : 'latest'
414+ }
415+ osType : 'Windows'
416+ osDisk : {
417+ name : 'osdisk-${jumpboxVmName }'
418+ managedDisk : {
419+ storageAccountType : 'Standard_LRS'
420+ }
421+ }
422+ encryptionAtHost : false // Some Azure subscriptions do not support encryption at host
423+ nicConfigurations : [
424+ {
425+ name : 'nic-${jumpboxVmName }'
426+ ipConfigurations : [
427+ {
428+ name : 'ipconfig1'
429+ subnetResourceId : virtualNetwork !.outputs .jumpboxSubnetResourceId
430+ }
431+ ]
432+ diagnosticSettings : [
433+ {
434+ name : 'jumpboxDiagnostics'
435+ workspaceResourceId : existingLogAnalyticsWorkspaceId
436+ logCategoriesAndGroups : [
437+ {
438+ categoryGroup : 'allLogs'
439+ enabled : true
440+ }
441+ ]
442+ metricCategories : [
443+ {
444+ category : 'AllMetrics'
445+ enabled : true
446+ }
447+ ]
448+ }
449+ ]
450+ }
451+ ]
452+ enableTelemetry : enableTelemetry
453+ }
454+ }
455+
356456// ========== Private DNS Zones ========== //
357457var privateDnsZones = [
358458 'privatelink.cognitiveservices.azure.com'
@@ -568,7 +668,7 @@ module avmStorageAccount 'br/public:avm/res/storage/storage-account:0.20.0' = {
568668 }
569669 ]
570670 }
571- subnetResourceId : virtualNetwork .outputs .containersSubnetResourceId // Use the backend subnet
671+ subnetResourceId : virtualNetwork .outputs .backendSubnetResourceId // Use the backend subnet
572672 service : 'blob'
573673 }
574674 {
@@ -582,7 +682,7 @@ module avmStorageAccount 'br/public:avm/res/storage/storage-account:0.20.0' = {
582682 }
583683 ]
584684 }
585- subnetResourceId : virtualNetwork .outputs .containersSubnetResourceId // Use the backend subnet
685+ subnetResourceId : virtualNetwork .outputs .backendSubnetResourceId // Use the backend subnet
586686 service : 'queue'
587687 }
588688 ]
@@ -679,7 +779,7 @@ module avmAiServices 'modules/account/main.bicep' = {
679779 }
680780 ]
681781 }
682- subnetResourceId : virtualNetwork .outputs .containersSubnetResourceId // Use the backend subnet
782+ subnetResourceId : virtualNetwork .outputs .backendSubnetResourceId // Use the backend subnet
683783 }
684784 ]
685785 : []
@@ -740,7 +840,7 @@ module avmAiServices_cu 'br/public:avm/res/cognitive-services/account:0.11.0' =
740840 }
741841 ]
742842 }
743- subnetResourceId : virtualNetwork .outputs .containersSubnetResourceId // Use the backend subnet
843+ subnetResourceId : virtualNetwork .outputs .backendSubnetResourceId // Use the backend subnet
744844 }
745845 ]
746846 : []
@@ -1080,7 +1180,7 @@ module avmCosmosDB 'br/public:avm/res/document-db/database-account:0.15.0' = {
10801180 ]
10811181 }
10821182 service : 'MongoDB'
1083- subnetResourceId : virtualNetwork .outputs .containersSubnetResourceId // Use the backend subnet
1183+ subnetResourceId : virtualNetwork .outputs .backendSubnetResourceId // Use the backend subnet
10841184 }
10851185 ]
10861186 : []
@@ -1257,7 +1357,7 @@ module avmAppConfig_update 'br/public:avm/res/app-configuration/configuration-st
12571357 }
12581358 ]
12591359 }
1260- subnetResourceId : virtualNetwork .outputs .containersSubnetResourceId // Use the backend subnet
1360+ subnetResourceId : virtualNetwork .outputs .backendSubnetResourceId // Use the backend subnet
12611361 }
12621362 ]
12631363 }
0 commit comments