@@ -1664,6 +1664,76 @@ var aiSearchIndexNameForRFPCompliance = 'macae-rfp-compliance-index'
16641664
16651665module searchService 'br/public:avm/res/search/search-service:0.11.1' = {
16661666 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 )
16671737 params : {
16681738 name : searchServiceName
16691739 authOptions : {
@@ -1732,6 +1802,9 @@ module searchService 'br/public:avm/res/search/search-service:0.11.1' = {
17321802 // ]
17331803 // : []
17341804 }
1805+ dependsOn : [
1806+ searchService
1807+ ]
17351808}
17361809
17371810// ========== Search Service - AI Project Connection ========== //
0 commit comments