@@ -1108,6 +1108,22 @@ module containerApp 'br/public:avm/res/app/container-app:0.14.2' = if (container
11081108 name : 'APP_ENV'
11091109 value : 'Prod'
11101110 }
1111+ {
1112+ name : 'AZURE_STORAGE_BLOB_URL'
1113+ value : avmStorageAccount .outputs .serviceEndpoints .blob
1114+ }
1115+ {
1116+ name : 'AZURE_STORAGE_CONTAINER_NAME'
1117+ value : storageContainerName
1118+ }
1119+ {
1120+ name : 'AZURE_SEARCH_ENDPOINT'
1121+ value : searchService .outputs .endpoint
1122+ }
1123+ {
1124+ name : 'AZURE_SEARCH_CONNECTION_NAME'
1125+ value : aiSearchConnectionName
1126+ }
11111127 ]
11121128 }
11131129 ]
@@ -1274,6 +1290,186 @@ module webSite 'br/public:avm/res/web/site:0.15.1' = if (webSiteEnabled) {
12741290 }
12751291}
12761292
1293+
1294+ // ========== Storage Account ========== //
1295+
1296+ module privateDnsZonesStorageAccount 'br/public:avm/res/network/private-dns-zone:0.7.0' = if (virtualNetworkEnabled ) {
1297+ name : take ('avm.res.network.private-dns-zone.storage-account.${solutionPrefix }' , 64 )
1298+ params : {
1299+ name : 'privatelink.blob.core.windows.net'
1300+ enableTelemetry : enableTelemetry
1301+ virtualNetworkLinks : [
1302+ {
1303+ name : 'vnetlink-storage-account'
1304+ virtualNetworkResourceId : virtualNetwork .outputs .resourceId
1305+ }
1306+ ]
1307+ tags : tags
1308+ }
1309+ }
1310+
1311+ var storageAccountName = replace ('st${solutionPrefix }' , '-' , '' )
1312+ param storageContainerName string = 'sample-dataset'
1313+ module avmStorageAccount 'br/public:avm/res/storage/storage-account:0.20.0' = {
1314+ name : take ('avm.res.storage.storage-account.${storageAccountName }' , 64 )
1315+ params : {
1316+ name : storageAccountName
1317+ location : solutionLocation
1318+ managedIdentities : { systemAssigned : true }
1319+ minimumTlsVersion : 'TLS1_2'
1320+ enableTelemetry : enableTelemetry
1321+ tags : tags
1322+ accessTier : 'Hot'
1323+ supportsHttpsTrafficOnly : true
1324+
1325+ roleAssignments : [
1326+ {
1327+ principalId : userAssignedIdentity .outputs .principalId
1328+ roleDefinitionIdOrName : 'Storage Blob Data Contributor'
1329+ principalType : 'ServicePrincipal'
1330+ }
1331+ {
1332+ principalId : deployingUserPrincipalId
1333+ roleDefinitionIdOrName : 'Storage Blob Data Contributor'
1334+ principalType : 'User'
1335+ }
1336+ ]
1337+
1338+ // WAF aligned networking
1339+ networkAcls : {
1340+ bypass : 'AzureServices'
1341+ defaultAction : virtualNetworkEnabled ? 'Deny' : 'Allow'
1342+ }
1343+ allowBlobPublicAccess : false
1344+ publicNetworkAccess : virtualNetworkEnabled ? 'Disabled' : 'Enabled'
1345+
1346+ // Private endpoints for blob
1347+ privateEndpoints : virtualNetworkEnabled
1348+ ? [
1349+ {
1350+ name : 'pep-blob-${solutionPrefix }'
1351+ privateDnsZoneGroup : {
1352+ privateDnsZoneGroupConfigs : [
1353+ {
1354+ name : 'storage-dns-zone-group-blob'
1355+ privateDnsZoneResourceId : privateDnsZonesStorageAccount .outputs .resourceId
1356+ }
1357+ ]
1358+ }
1359+ subnetResourceId : virtualNetwork .outputs .subnetResourceIds [0 ]
1360+ service : 'blob'
1361+ }
1362+ ]
1363+ : []
1364+ blobServices : {
1365+ automaticSnapshotPolicyEnabled : true
1366+ containerDeleteRetentionPolicyDays : 10
1367+ containerDeleteRetentionPolicyEnabled : true
1368+ containers : [
1369+ {
1370+ name : storageContainerName
1371+ publicAccess : 'None'
1372+ }
1373+ ]
1374+ deleteRetentionPolicyDays : 9
1375+ deleteRetentionPolicyEnabled : true
1376+ lastAccessTimeTrackingPolicyEnabled : true
1377+ }
1378+ }
1379+ }
1380+
1381+ // ========== Search Service ========== //
1382+
1383+ module privateDnsZonesSearchService 'br/public:avm/res/network/private-dns-zone:0.7.0' = if (virtualNetworkEnabled ) {
1384+ name : take ('avm.res.network.private-dns-zone.search-service.${solutionPrefix }' , 64 )
1385+ params : {
1386+ name : 'privatelink.search.windows.net'
1387+ enableTelemetry : enableTelemetry
1388+ virtualNetworkLinks : [
1389+ {
1390+ name : 'vnetlink-search-service'
1391+ virtualNetworkResourceId : virtualNetwork .outputs .resourceId
1392+ }
1393+ ]
1394+ tags : tags
1395+ }
1396+ }
1397+
1398+ var searchServiceName = 'srch-${solutionPrefix }'
1399+ module searchService 'br/public:avm/res/search/search-service:0.11.1' = {
1400+ name : take ('avm.res.search.search-service.${solutionPrefix }' , 64 )
1401+ params : {
1402+ name : searchServiceName
1403+ authOptions : {
1404+ aadOrApiKey : {
1405+ aadAuthFailureMode : 'http401WithBearerChallenge'
1406+ }
1407+ }
1408+ disableLocalAuth : false
1409+ hostingMode : 'default'
1410+ managedIdentities : {
1411+ systemAssigned : true
1412+ }
1413+ publicNetworkAccess : virtualNetworkEnabled ? 'Disabled' : 'Enabled'
1414+ networkRuleSet : {
1415+ bypass : 'AzureServices'
1416+ }
1417+ partitionCount : 1
1418+ replicaCount : 1
1419+ sku : 'standard'
1420+ tags : tags
1421+ roleAssignments : [
1422+ {
1423+ principalId : userAssignedIdentity .outputs .principalId
1424+ roleDefinitionIdOrName : 'Search Index Data Contributor'
1425+ principalType : 'ServicePrincipal'
1426+ }
1427+ {
1428+ principalId : deployingUserPrincipalId
1429+ roleDefinitionIdOrName : 'Search Index Data Contributor'
1430+ principalType : 'User'
1431+ }
1432+ ]
1433+ privateEndpoints : virtualNetworkEnabled
1434+ ? [
1435+ {
1436+ name : 'pep-search-${solutionPrefix }'
1437+ privateDnsZoneGroup : {
1438+ privateDnsZoneGroupConfigs : [
1439+ {
1440+ privateDnsZoneResourceId : privateDnsZonesSearchService .outputs .resourceId
1441+ }
1442+ ]
1443+ }
1444+ subnetResourceId : virtualNetwork .outputs .subnetResourceIds [0 ]
1445+ service : 'searchService'
1446+ }
1447+ ]
1448+ : []
1449+ }
1450+ }
1451+
1452+ // ========== Search Service - AI Project Connection ========== //
1453+
1454+ var aiSearchConnectionName = 'aifp-srch-connection-${solutionPrefix }'
1455+ var aifSubscriptionId = useExistingFoundryProject ? split (existingFoundryProjectResourceId , '/' )[2 ] : subscription ().subscriptionId
1456+ var aifResourceGroup = useExistingFoundryProject ? split (existingFoundryProjectResourceId , '/' )[4 ] : resourceGroup ().name
1457+ module aiSearchFoundryConnection 'modules/aifp_search_connection.bicep' = if (aiFoundryAIservicesEnabled ) {
1458+ name : take ('aifp-srch-connection.${solutionPrefix }' , 64 )
1459+ scope : resourceGroup (aifSubscriptionId , aifResourceGroup )
1460+ params : {
1461+ aiFoundryProjectName : aiFoundryAiProjectName
1462+ aiFoundryName : aiFoundryAiServicesResourceName
1463+ aifSearchConnectionName : aiSearchConnectionName
1464+ searchServiceResourceId : searchService .outputs .resourceId
1465+ searchServiceLocation : searchService .outputs .location
1466+ searchServiceName : searchService .outputs .name
1467+ }
1468+ dependsOn : [
1469+ aiFoundryAiServices
1470+ ]
1471+ }
1472+
12771473// ============ //
12781474// Outputs //
12791475// ============ //
@@ -1283,6 +1479,11 @@ module webSite 'br/public:avm/res/web/site:0.15.1' = if (webSiteEnabled) {
12831479@description ('The default url of the website to connect to the Multi-Agent Custom Automation Engine solution.' )
12841480output webSiteDefaultHostname string = webSite .outputs .defaultHostname
12851481
1482+ output AZURE_STORAGE_BLOB_URL string = avmStorageAccount .outputs .serviceEndpoints .blob
1483+ output AZURE_STORAGE_ACCOUNT_NAME string = storageAccountName
1484+ output AZURE_STORAGE_CONTAINER_NAME string = storageContainerName
1485+ output AZURE_SEARCH_ENDPOINT string = searchService .outputs .endpoint
1486+ output AZURE_SEARCH_NAME string = searchService .outputs .name
12861487
12871488
12881489output AZURE_CONTAINER_REGISTRY_ENDPOINT string = containerRegistry .outputs .loginServer
0 commit comments