@@ -65,7 +65,7 @@ param resourceGroupLocation string = resourceGroup().location
6565param resourceNameFormatString string = '{0}avm-cps'
6666
6767@description ('Optional. Enable WAF for the deployment.' )
68- param enablePrivateNetworking bool = false
68+ param enablePrivateNetworking bool = true
6969
7070@description ('Optional. Enable/Disable usage telemetry for module.' )
7171param enableTelemetry bool = true
@@ -81,6 +81,9 @@ param useLocalBuild bool = false
8181@description ('Optional. Enable scaling for the container apps. Defaults to false.' )
8282param enableScaling bool = false
8383
84+ @description ('Optional: Existing Log Analytics Workspace Resource ID' )
85+ param existingLogAnalyticsWorkspaceId string = ''
86+
8487// ========== Solution Prefix Variable ========== //
8588// @description('Optional. A unique deployment timestamp for solution prefix generation.')
8689// param deploymentTimestamp string = utcNow()
@@ -560,16 +563,14 @@ module avmPrivateDnsZones 'br/public:avm/res/network/private-dns-zone:0.7.1' = [
560563// }
561564// }
562565
563- module logAnalyticsWorkspace 'br/public:avm/res/operational-insights/ workspace:0.11.2 ' = {
566+ module logAnalyticsWorkspace 'modules/log-analytics- workspace.bicep ' = {
564567 name : 'deploy_log_analytics_workspace'
565568 params : {
566569 name : 'log-${solutionPrefix }'
567570 location : location
568- skuName : 'PerGB2018'
569- dataRetention : 30
570- diagnosticSettings : [{ useThisWorkspace : true }]
571571 tags : tags
572572 enableTelemetry : enableTelemetry
573+ existingLogAnalyticsWorkspaceId : existingLogAnalyticsWorkspaceId
573574 }
574575}
575576
@@ -1041,6 +1042,7 @@ module avmAiServices 'br/public:avm/res/cognitive-services/account:0.11.0' = {
10411042 name : 'aisa-${solutionPrefix }'
10421043 location : aiDeploymentsLocation
10431044 sku : 'S0'
1045+ allowProjectManagement : true
10441046 managedIdentities : { systemAssigned : true }
10451047 kind : 'AIServices'
10461048 tags : {
@@ -1126,6 +1128,15 @@ module avmAiServices 'br/public:avm/res/cognitive-services/account:0.11.0' = {
11261128 }
11271129}
11281130
1131+ module project 'modules/ai-foundry-project.bicep' = {
1132+ name : format (resourceNameFormatString , 'aifp-' )
1133+ params : {
1134+ name : 'aifp--${solutionPrefix }'
1135+ location : resourceGroup ().location
1136+ aiServicesName : avmAiServices .outputs .name
1137+ }
1138+ }
1139+
11291140// Role Assignment
11301141// module avmAiServices_roleAssignment 'br/public:avm/ptn/authorization/resource-role-assignment:0.1.2' = {
11311142// name: format(resourceNameFormatString, 'rbac-ai-services')
@@ -1202,172 +1213,6 @@ module avmAiServices_cu 'br/public:avm/res/cognitive-services/account:0.11.0' =
12021213 }
12031214}
12041215
1205- module avmAiServices_storage_hub 'br/public:avm/res/storage/storage-account:0.20.0' = {
1206- name : format (resourceNameFormatString , 'aistoragehub-' )
1207- params : {
1208- name : 'aisthub${replace (solutionPrefix , '-' , '' )}'
1209- location : resourceGroupLocation
1210- //skuName: 'Standard_LRS'
1211- //kind: 'StorageV2'
1212- managedIdentities : { systemAssigned : true }
1213- minimumTlsVersion : 'TLS1_2'
1214- networkAcls : {
1215- bypass : 'AzureServices'
1216- defaultAction : 'Deny'
1217- }
1218- tags : tags
1219- supportsHttpsTrafficOnly : true
1220- accessTier : 'Hot'
1221- allowBlobPublicAccess : false
1222- allowCrossTenantReplication : false
1223- allowSharedKeyAccess : false
1224- diagnosticSettings : [
1225- {
1226- workspaceResourceId : logAnalyticsWorkspace .outputs .resourceId
1227- }
1228- ]
1229- enableTelemetry : enableTelemetry
1230- roleAssignments : [
1231- {
1232- principalId : avmManagedIdentity .outputs .principalId
1233- roleDefinitionIdOrName : 'Storage Blob Data Contributor'
1234- }
1235- ]
1236-
1237- publicNetworkAccess : 'Disabled' // Always enabled for AI Storage Hub
1238- // WAF related parameters
1239- //publicNetworkAccess: (deployment_param.enable_waf) ? 'Disabled' : 'Enabled'
1240- privateEndpoints : (enablePrivateNetworking )
1241- ? [
1242- {
1243- name : 'aistoragehub-private-endpoint-blob-${solutionPrefix }'
1244- privateEndpointResourceId : avmVirtualNetwork .outputs .resourceId
1245- service : 'blob'
1246- privateDnsZoneGroup : {
1247- privateDnsZoneGroupConfigs : [
1248- {
1249- name : 'aistoragehub-dns-zone-blob'
1250- privateDnsZoneResourceId : avmPrivateDnsZones [dnsZoneIndex .storageBlob ].outputs .resourceId
1251- //privateDnsZoneResourceId: avmPrivateDnsZoneStorages[0].outputs.resourceId
1252- }
1253- ]
1254- }
1255- subnetResourceId : avmVirtualNetwork .outputs .subnetResourceIds [0 ] // Use the backend subnet
1256- }
1257- {
1258- name : 'aistoragehub-private-endpoint-file-${solutionPrefix }'
1259- privateEndpointResourceId : avmVirtualNetwork .outputs .resourceId
1260- service : 'file'
1261- privateDnsZoneGroup : {
1262- privateDnsZoneGroupConfigs : [
1263- {
1264- name : 'aistoragehub-dns-zone-file'
1265- privateDnsZoneResourceId : avmPrivateDnsZones [dnsZoneIndex .storageFile ].outputs .resourceId
1266- //privateDnsZoneResourceId: avmPrivateDnsZoneStorages[1].outputs.resourceId
1267- }
1268- ]
1269- }
1270- subnetResourceId : avmVirtualNetwork .outputs .subnetResourceIds [0 ] // Use the backend subnet
1271- }
1272- ]
1273- : []
1274- }
1275- }
1276-
1277- var aiHubStorageResourceId = '/subscriptions/${subscription ().subscriptionId }/resourceGroups/${resourceGroup ().name }/providers/Microsoft.Storage/storageAccounts/${avmAiServices_storage_hub .outputs .name }'
1278-
1279- module avmAiHub 'br/public:avm/res/machine-learning-services/workspace:0.12.1' = {
1280- name : format (resourceNameFormatString , 'aih-' )
1281- params : {
1282- name : 'aih-${solutionPrefix }'
1283- friendlyName : 'aih-${solutionPrefix }'
1284- description : 'AI Hub for CPS template'
1285- location : resourceGroupLocation
1286- sku : 'Basic'
1287- managedIdentities : {
1288- userAssignedResourceIds : [
1289- avmManagedIdentity .outputs .resourceId
1290- ]
1291- }
1292- tags : {
1293- app : solutionPrefix
1294- location : resourceGroupLocation
1295- }
1296- // dependent resources
1297- associatedKeyVaultResourceId : avmKeyVault .outputs .resourceId
1298- primaryUserAssignedIdentity : avmManagedIdentity .outputs .resourceId
1299- associatedStorageAccountResourceId : aiHubStorageResourceId //avmAiServices_storage_hub.outputs.resourceId
1300- associatedContainerRegistryResourceId : avmContainerRegistry .outputs .resourceId
1301- associatedApplicationInsightsResourceId : applicationInsights .outputs .resourceId
1302- enableTelemetry : enableTelemetry
1303- kind : 'Hub'
1304- connections : [
1305- {
1306- name : 'AzureOpenAI-Connection'
1307- category : 'AIServices'
1308- target : avmAiServices .outputs .endpoint
1309- connectionProperties : {
1310- authType : 'AAD'
1311- }
1312- isSharedToAll : true
1313-
1314- metadata : {
1315- description : 'Connection to Azure OpenAI'
1316- ApiType : 'Azure'
1317- resourceId : avmAiServices .outputs .resourceId
1318- }
1319- }
1320- ]
1321-
1322- publicNetworkAccess : (enablePrivateNetworking ) ? 'Disabled' : 'Enabled' // Always enabled for AI Hub
1323- //<======================= WAF related parameters
1324- // publicNetworkAccess: (deployment_param.enable_waf) ? 'Disabled' : 'Enabled'
1325- privateEndpoints : (enablePrivateNetworking )
1326- ? [
1327- {
1328- name : 'ai-hub-private-endpoint-${solutionPrefix }'
1329- privateEndpointResourceId : avmVirtualNetwork .outputs .resourceId
1330- privateDnsZoneGroup : {
1331- privateDnsZoneGroupConfigs : [
1332- {
1333- name : 'ai-hub-dns-zone-amlworkspace'
1334- privateDnsZoneResourceId : avmPrivateDnsZones [dnsZoneIndex .aiFoundry ].outputs .resourceId
1335- //privateDnsZoneResourceId: avmPrivateDnsZoneAiFoundryWorkspace[0].outputs.resourceId
1336- }
1337- {
1338- name : 'ai-hub-dns-zone-notebooks'
1339- privateDnsZoneResourceId : avmPrivateDnsZones [dnsZoneIndex .notebooks ].outputs .resourceId
1340- //privateDnsZoneResourceId: avmPrivateDnsZoneAiFoundryWorkspace[1].outputs.resourceId
1341- }
1342- ]
1343- }
1344- subnetResourceId : avmVirtualNetwork .outputs .subnetResourceIds [0 ] // Use the backend subnet
1345- }
1346- ]
1347- : []
1348- }
1349- }
1350-
1351- module avmAiProject 'br/public:avm/res/machine-learning-services/workspace:0.12.1' = {
1352- name : format (resourceNameFormatString , 'aihp-' )
1353- params : {
1354- name : 'aihp-${solutionPrefix }'
1355- location : resourceGroupLocation
1356- managedIdentities : {
1357- userAssignedResourceIds : [
1358- avmManagedIdentity .outputs .resourceId
1359- ]
1360- }
1361- kind : 'Project'
1362- sku : 'Basic'
1363- friendlyName : 'aihp-${solutionPrefix }'
1364- primaryUserAssignedIdentity : avmManagedIdentity .outputs .resourceId
1365- hubResourceId : avmAiHub .outputs .resourceId
1366- enableTelemetry : enableTelemetry
1367- tags : tags
1368- }
1369- }
1370-
13711216// ========== Container App Environment ========== //
13721217module avmContainerAppEnv 'br/public:avm/res/app/managed-environment:0.11.2' = {
13731218 name : format (resourceNameFormatString , 'cae-' )
@@ -1875,8 +1720,8 @@ module avmAppConfig 'br/public:avm/res/app-configuration/configuration-store:0.6
18751720 value : avmStorageAccount .outputs .serviceEndpoints .queue
18761721 }
18771722 {
1878- name : 'APP_AI_PROJECT_CONN_STR '
1879- value : '${ resourceGroupLocation }.api.azureml.ms;${ subscription (). subscriptionId };${ resourceGroup (). name };${ avmAiProject . name }'
1723+ name : 'APP_AI_PROJECT_ENDPOINT '
1724+ value : project . outputs . projectEndpoint
18801725 }
18811726 {
18821727 name : 'APP_COSMOS_CONNSTR'
@@ -1912,7 +1757,7 @@ module avmAppConfig 'br/public:avm/res/app-configuration/configuration-store:0.6
19121757 avmAiServices_cu
19131758 avmStorageAccount
19141759 avmCosmosDB
1915- avmAiProject
1760+ project
19161761 ]
19171762}
19181763
0 commit comments