@@ -225,6 +225,7 @@ var allTags = union(
225225 },
226226 tags
227227)
228+ var existingTags = resourceGroup ().tags ?? {}
228229@description ('Tag, Created by user name' )
229230param createdBy string = contains (deployer (), 'userPrincipalName' )
230231 ? split (deployer ().userPrincipalName , '@' )[0 ]
@@ -234,15 +235,17 @@ var deployerPrincipalType = contains(deployer(), 'userPrincipalName') ? 'User' :
234235resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
235236 name : 'default'
236237 properties : {
237- tags : {
238- ...resourceGroup ().tags
239- ...allTags
240- TemplateName : 'MACAE'
241- Type : enablePrivateNetworking ? 'WAF' : 'Non-WAF'
242- CreatedBy : createdBy
243- DeploymentName : deployment ().name
244- SolutionSuffix : solutionSuffix
245- }
238+ tags : union (
239+ existingTags ,
240+ allTags ,
241+ {
242+ TemplateName : 'MACAE'
243+ Type : enablePrivateNetworking ? 'WAF' : 'Non-WAF'
244+ CreatedBy : createdBy
245+ DeploymentName : deployment ().name
246+ SolutionSuffix : solutionSuffix
247+ }
248+ )
246249 }
247250}
248251
@@ -1661,6 +1664,76 @@ var aiSearchIndexNameForRFPCompliance = 'macae-rfp-compliance-index'
16611664
16621665module searchService 'br/public:avm/res/search/search-service:0.11.1' = {
16631666 name : take ('avm.res.search.search-service.${solutionSuffix }' , 64 )
1667+ params : {
1668+ name : searchServiceName
1669+ authOptions : {
1670+ aadOrApiKey : {
1671+ aadAuthFailureMode : 'http401WithBearerChallenge'
1672+ }
1673+ }
1674+ disableLocalAuth : false
1675+ hostingMode : 'default'
1676+
1677+ // Enabled the Public access because other services are not able to connect with search search AVM module when public access is disabled
1678+
1679+ // publicNetworkAccess: enablePrivateNetworking ? 'Disabled' : 'Enabled'
1680+ publicNetworkAccess : 'Enabled'
1681+ networkRuleSet : {
1682+ bypass : 'AzureServices'
1683+ }
1684+ partitionCount : 1
1685+ replicaCount : 1
1686+ sku : enableScalability ? 'standard' : 'basic'
1687+ tags : tags
1688+ roleAssignments : [
1689+ {
1690+ principalId : userAssignedIdentity .outputs .principalId
1691+ roleDefinitionIdOrName : 'Search Index Data Contributor'
1692+ principalType : 'ServicePrincipal'
1693+ }
1694+ {
1695+ principalId : deployingUserPrincipalId
1696+ roleDefinitionIdOrName : 'Search Index Data Contributor'
1697+ principalType : deployerPrincipalType
1698+ }
1699+ {
1700+ principalId : aiFoundryAiProjectPrincipalId
1701+ roleDefinitionIdOrName : 'Search Index Data Reader'
1702+ principalType : 'ServicePrincipal'
1703+ }
1704+ {
1705+ principalId : aiFoundryAiProjectPrincipalId
1706+ roleDefinitionIdOrName : 'Search Service Contributor'
1707+ principalType : 'ServicePrincipal'
1708+ }
1709+ ]
1710+
1711+ //Removing the Private endpoints as we are facing the issue with connecting to search service while comminicating with agents
1712+
1713+ privateEndpoints : []
1714+ // privateEndpoints: enablePrivateNetworking
1715+ // ? [
1716+ // {
1717+ // name: 'pep-search-${solutionSuffix}'
1718+ // customNetworkInterfaceName: 'nic-search-${solutionSuffix}'
1719+ // privateDnsZoneGroup: {
1720+ // privateDnsZoneGroupConfigs: [
1721+ // {
1722+ // privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.search]!.outputs.resourceId
1723+ // }
1724+ // ]
1725+ // }
1726+ // subnetResourceId: virtualNetwork!.outputs.subnetResourceIds[0]
1727+ // service: 'searchService'
1728+ // }
1729+ // ]
1730+ // : []
1731+ }
1732+ }
1733+
1734+ // Separate module for Search Service to enable managed identity, as this reduces deployment time
1735+ module searchServiceIdentity 'br/public:avm/res/search/search-service:0.11.1' = {
1736+ name : take ('avm.res.search.identity.${solutionSuffix }' , 64 )
16641737 params : {
16651738 name : searchServiceName
16661739 authOptions : {
@@ -1729,6 +1802,9 @@ module searchService 'br/public:avm/res/search/search-service:0.11.1' = {
17291802 // ]
17301803 // : []
17311804 }
1805+ dependsOn : [
1806+ searchService
1807+ ]
17321808}
17331809
17341810// ========== Search Service - AI Project Connection ========== //
0 commit comments