@@ -1661,6 +1661,76 @@ var aiSearchIndexNameForRFPCompliance = 'macae-rfp-compliance-index'
16611661
16621662module searchService 'br/public:avm/res/search/search-service:0.11.1' = {
16631663 name : take ('avm.res.search.search-service.${solutionSuffix }' , 64 )
1664+ params : {
1665+ name : searchServiceName
1666+ authOptions : {
1667+ aadOrApiKey : {
1668+ aadAuthFailureMode : 'http401WithBearerChallenge'
1669+ }
1670+ }
1671+ disableLocalAuth : false
1672+ hostingMode : 'default'
1673+
1674+ // Enabled the Public access because other services are not able to connect with search search AVM module when public access is disabled
1675+
1676+ // publicNetworkAccess: enablePrivateNetworking ? 'Disabled' : 'Enabled'
1677+ publicNetworkAccess : 'Enabled'
1678+ networkRuleSet : {
1679+ bypass : 'AzureServices'
1680+ }
1681+ partitionCount : 1
1682+ replicaCount : 1
1683+ sku : enableScalability ? 'standard' : 'basic'
1684+ tags : tags
1685+ roleAssignments : [
1686+ {
1687+ principalId : userAssignedIdentity .outputs .principalId
1688+ roleDefinitionIdOrName : 'Search Index Data Contributor'
1689+ principalType : 'ServicePrincipal'
1690+ }
1691+ {
1692+ principalId : deployingUserPrincipalId
1693+ roleDefinitionIdOrName : 'Search Index Data Contributor'
1694+ principalType : deployerPrincipalType
1695+ }
1696+ {
1697+ principalId : aiFoundryAiProjectPrincipalId
1698+ roleDefinitionIdOrName : 'Search Index Data Reader'
1699+ principalType : 'ServicePrincipal'
1700+ }
1701+ {
1702+ principalId : aiFoundryAiProjectPrincipalId
1703+ roleDefinitionIdOrName : 'Search Service Contributor'
1704+ principalType : 'ServicePrincipal'
1705+ }
1706+ ]
1707+
1708+ //Removing the Private endpoints as we are facing the issue with connecting to search service while comminicating with agents
1709+
1710+ privateEndpoints : []
1711+ // privateEndpoints: enablePrivateNetworking
1712+ // ? [
1713+ // {
1714+ // name: 'pep-search-${solutionSuffix}'
1715+ // customNetworkInterfaceName: 'nic-search-${solutionSuffix}'
1716+ // privateDnsZoneGroup: {
1717+ // privateDnsZoneGroupConfigs: [
1718+ // {
1719+ // privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.search]!.outputs.resourceId
1720+ // }
1721+ // ]
1722+ // }
1723+ // subnetResourceId: virtualNetwork!.outputs.subnetResourceIds[0]
1724+ // service: 'searchService'
1725+ // }
1726+ // ]
1727+ // : []
1728+ }
1729+ }
1730+
1731+ // Separate module for Search Service to enable managed identity, as this reduces deployment time
1732+ module searchServiceIdentity 'br/public:avm/res/search/search-service:0.11.1' = {
1733+ name : take ('avm.res.search.identity.${solutionSuffix }' , 64 )
16641734 params : {
16651735 name : searchServiceName
16661736 authOptions : {
@@ -1729,6 +1799,9 @@ module searchService 'br/public:avm/res/search/search-service:0.11.1' = {
17291799 // ]
17301800 // : []
17311801 }
1802+ dependsOn : [
1803+ searchService
1804+ ]
17321805}
17331806
17341807// ========== Search Service - AI Project Connection ========== //
0 commit comments